rsyslog-test

5
2
Source

Standardizes testing and validation for rsyslog using the diag.sh framework.

Install

mkdir -p .claude/skills/rsyslog-test && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2339" && unzip -o skill.zip -d .claude/skills/rsyslog-test && rm skill.zip

Installs to .claude/skills/rsyslog-test

About this skill

rsyslog_test

This skill provides guidelines and tools for running tests efficiently. It emphasizes direct test script execution to avoid the overhead and opacity of the full make check harness.

Quick Start

  1. Build First: Ensure the project is built (use rsyslog_build).
  2. Run Specific Test: ./tests/<test-name>.sh
  3. Run with Valgrind: ./tests/<test-name>-vg.sh

Detailed Instructions

1. Direct Execution Rule

NEVER use make check during routine development. It is slow (runs 1000+ tests) and hides failure details.

  • Rule: Run individual shell scripts directly from the tests/ directory.
  • Benefit: Immediate feedback and visible stdout/stderr.

2. Test Registration (tests/Makefile.am)

New tests MUST be registered using the "Define at Top, Distribute Unconditionally, Register Conditionally" pattern. This ensures make distcheck validity.

  1. Define Variable: Group your tests into a descriptive variable at the top of tests/Makefile.am (before the if ENABLE_TESTBENCH block).
    TESTS_MYMODULE = \
        test1.sh \
        test2.sh
    
  2. Unconditional Distribution: Add it to EXTRA_DIST immediately after definition. NEVER add test scripts to EXTRA_DIST inside a conditional block.
    EXTRA_DIST += $(TESTS_MYMODULE)
    
  3. Conditional Registration: Append the variable to the global TESTS list inside the appropriate if ENABLE_... block.
    if ENABLE_MYMODULE_TESTS
    TESTS += $(TESTS_MYMODULE)
    endif
    
  4. Serialization: If tests must run in order, add .log dependencies:
    test2.log: test1.log
    

3. Using diag.sh Helpers

All tests source tests/diag.sh. You should use its standardized helpers:

  • cmp_exact: Verify file content matches.
  • require_plugin: Skip test if a module is not built.
  • command_deny: Ensure a specific command fails.

4. Valgrind Testing

For memory leak and race condition detection:

  • Use scripts ending in -vg.sh.
  • These are wrappers that set USE_VALGRIND=1 and source the base test.

5. Debugging Failed Tests

If a test fails, you can inspect logs by:

  • Enabling debug: Uncomment RSYSLOG_DEBUG exports in tests/diag.sh.
  • Disabling cleanup: Comment out exit_test at the end of the script.
  • Output files: Look for rstb_*.out.log and log.

6. Integration Test Policy

Certain modules (Kafka, Elasticsearch, Journald) have heavy integration tests requiring external services.

  • Policy: Skip these in restricted environments (like AI sandboxes) unless build-only validation is insufficient.
  • Check module-specific AGENTS.md or MODULE_METADATA.yaml.

7. Memory Lifecycle Validation (Mental Audit)

Before committing C changes, agents SHOULD perform a self-audit of memory ownership and lifecycle.

  • Rule: Run the /audit workflow. It orchestrates multiple specialized passes (Memory Guardian, Concurrency Architect) using the Canned Prompts.
  • Critical Patterns:
    • NULL Checks: es_str2cstr() can return NULL. Every call MUST be followed by a NULL check.
    • Macro Usage: Prefer CHKmalloc() for allocations as it automatically handles the NULL check and jumps to finalize_it.
  • Focus: Pay special attention to RS_RET error paths, es_str2cstr() checks, and strdup calls.

8. Mock Smoke Check (Fast Distcheck)

Whenever you add or rename test scripts, you MUST run a fast distribution check to ensure all files are correctly registered and invocable in a VPATH build. This avoids breaking CI for distribution-related issues.

Command:

make distcheck TEST_RUN_TYPE=MOCK-OK -j$(nproc)
  • Pattern: This uses the MOCK-OK mode in tests/diag.sh to exit tests with success immediately, skipping the overhead of actual execution while still verifying shell script invocability and distribution completeness.

Related Skills

  • rsyslog_build: Required before running tests.
  • rsyslog_module: Documentation on module-specific test dependencies.

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,6881,430

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,2721,338

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,5471,154

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,359809

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,269732

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,498687