Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assertions

This repository hosts:

  1. Official and community-made assertions on active monitoring
  2. Samples for running tests

[Contribute] Assertions

The templates/ directory contains reusable Rice script templates organized per folder.

Structure

templates/
├── bundle.json                 # Generated bundle of all templates
├── schema.json                 # Manifest JSON schema
└── {template-name}/
    └── manifest.yml            # Template metadata + embedded Rice script

Manifest

Each template folder contains a manifest.yml (YAML) defining the template name, description, display order, and the Rice script embedded directly under script:.

Bundling templates

Bundle all templates into a single bundle.json with checksums:

go run ./tools/bundle_templates.go

[Contribute] Test Samples

The test-samples/ directory contains mock check results used to validate check scripts.

Structure

test-samples/
├── bundle.json          # Auto-generated bundle of all samples (inlined metadata + payload)
├── index.json           # Auto-generated index of all samples
└── src/{protocol}/      # Sample files organized by protocol (http, https, mcp, tcp, tls, minecraft)
    ├── {sample}.json    # Metadata (check result payload)
    └── {sample}.txt     # Payload (request debug dump)

Step 1: Indexing samples

Scan all sample files and regenerate index.json:

go run ./tools/index_test_samples.go

Step 2: Bundling samples

Bundle all samples into a single self-contained bundle.json, embedding each sample's metadata and payload inline as Base64:

go run ./tools/bundle_test_samples.go

[Other] Template Testing

The template-testing/ directory contains the test runner that validates every template against all test samples.

Structure

template-testing/
├── eat.rice          # Test script template — uses `#{{__script__}}` placeholder injected at runtime
├── main.go           # Minimal entry point
└── main_test.go      # Test runner — executes eat.rice + each template script against all indexed samples

How it works

main_test.go loads templates/bundle.json and test-samples/index.json, then for each template injects its script into the eat.rice template (replacing the #{{__script__}} placeholder) and executes the combined script against every test sample.

Running tests

Execute the Rice test script against every sample:

go test ./template-testing/... -v

About

The central repo to host official and community assertions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages