Grammar:
<step> => <assertStep> | <createStep> | <changeStep> | <deleteStep>
<assertStep> => "assert" ( <count> [<class>] <object> [<is> <phase>] | api <version> <kind> [<group>] ) [<within> <duration>]
<createStep> => "create" <count> ( <class> <object> | instance[s] of <path/to/yaml/file> )
<changeStep> => "change" <count> <class> <object> "from" <phase> "to" <phase>
<deleteStep> => "delete" <count> ( <class> <object> | instance[s] of <path/to/yaml/file> )
<is> => "is" | "are"
<count> => [1-9][0-9]*
<class> => [A-Za-z0-9\-]+
<object> => "pod[s]" | "node[s]"
<phase> => "Pending" | "Running" | "Succeeded" | "Failed" | "Unknown"
<duration> => time.Duration
Supported steps:
- Assert
- Create
- Change
- Delete
1. Assert: Assert can be used to assert the state of a node, a pod or an API within a specific timeout. For example:
- Node:
"assert 2 small nodes within 5s"
: This would assert that 2 small nodes are available within 5 seconds
- Pod
"assert 2 1-cpu pods are Running within 5s"
: This would assert that 2 pods of class1-cpu
are Runnning within 5 seconds
- Api:
"assert api v1 Test example.com within 5s"
: This would assert that the api endpoint forGroup: example.com
Version: v1
andKind: Test
is available within 5 seconds
2. Create: This step creates the specified resources. For example:
- Node:
"create 1 large node"
: This would create 1 instance of a node of classlarge
(definition of the class specified as a--nodeConfig
tonptest
)
- Pod:
"create 1 4-cpu pod"
: This would create 1 instance of a pod of class4-cpu
(definition of the class specified as a--podConfig
tonptest
)
- Yaml:
"create 1 instance of example.yml"
: This creates 1 instance of all the objects specified in the yaml
3. Change: This step can be used to change the state of a pod or set of pods from one state to another. Example:
"change 1 1-cpu pod from Running to Failed"
: Changes the state of 1 pod of class1-cpu
(definition of the class specified as a--podConfig
tonptest
) fromRunning
toFailed
4. Delete: This step can be used to delete the specified resource. For example:
- Node:
"delete 1 large node"
: This deletes 1 instance of a node of classlarge
(definition of the class specified as a--nodeConfig
tonptest
)
- Pod:
"delete 1 4-cpu pod"
: This deletes 1 instance of a pod of class4-cpu
(definition of the class specified as a--podConfig
tonptest
)
- Yaml:
"delete 1 instance of example.yml"
: This deletes 1 instance of all the objects specified in the yaml
Note: Fore more examples, check all the scenario yamls here.