diff --git a/docs/YAMLFormat.md b/docs/YAMLFormat.md index 5a2640e..ada169a 100644 --- a/docs/YAMLFormat.md +++ b/docs/YAMLFormat.md @@ -76,6 +76,28 @@ name *Note: The name specified here is used as part of the test execution name, in conjunction with the test_title. +annotation +---- +**Description**: Arbitrary meta data that can be used by programs that extend FTW. + +**Syntax:** ```annotation: ""``` + +**Example Usage:** + +``` +annotation: + test-sets: ["test-setA", "test-setX"] +``` + +**Default Value:** "" + +**Scope:** Metadata + +**Added Version:** TBF + +*Note: This field itself has no effect on FTW. +However, programs that extend the FTW can use this field to embed arbitrary metadata in each test file in a format they define. + Tests Parameters ================ The tests area is made up of multiple tests. Each test contains Stages and an optional rule_id. Within the Stage there is additional information that is outlined in Stage Parameters @@ -124,6 +146,30 @@ desc *Note: this keyword isn't mandatory, and not part of the structure of test case, ftw doesn't use it* +annotation +---- +**Description**: Arbitrary meta data that can be used by programs that extend FTW. + +**Syntax:** ```annotation: ""``` + +**Example Usage:** + +``` +annotation: + skip: + runtime: + is: modsec3-nginx +``` + +**Default Value:** "" + +**Scope:** Tests + +**Added Version:** TBF + +*Note: This field itself has no effect on FTW. +However, programs that extend the FTW can use this field to embed arbitrary metadata per test case in a format they define. + Stage Parameters ================ There can be multiple stages per test. Each stage represents a single request/response. Each stage parameter encapsulates an input and output parameters. diff --git a/ftw/ruleset.py b/ftw/ruleset.py index 04f951c..494ddde 100644 --- a/ftw/ruleset.py +++ b/ftw/ruleset.py @@ -155,6 +155,9 @@ def __init__(self, test_dict, ruleset_meta): self.enabled = True if 'enabled' in self.test_dict: self.enabled = self.test_dict['enabled'] + self.annotation = None + if 'annotation' in self.test_dict: + self.annotation = self.test_dict['annotation'] def build_stages(self): """ @@ -175,6 +178,9 @@ def __init__(self, yaml_file): self.author = self.meta['author'] self.description = self.meta['description'] self.enabled = self.meta['enabled'] + self.annotation = None + if 'annotation' in self.meta: + self.annotation = self.meta['annotation'] self.tests = self.extract_tests() if self.enabled else [] def extract_tests(self):