The testcase should be written in JSON format, including five parts: "Description", "Requires", "Deploy", "Run" and "Collect".
{"Description": {}, "Requires": {}, "Deploys":{}, "Run": {}, "Collect": {}}
The case developer should fill in the following informations: "Name", "Owner", "Version", "Summary", "Licence", "Group", "URL", "Description", "Source". (Yes, looks like rpm spec)
{"Name": "Test001",
"Owner", "[email protected]",
"Summary": "demo test",
"License": "Apache 2.0" //default
"Group": "Performance/Network", // The first category group is Performance/Spec/Function
// The 'Group' is used to category each test case,
// we assume/hope that there will be 'lots of' test cases,
// so search one by the group
"URL": "github://test",
"Details": "This is the detail description",
"Source": ["a.dockerfile","b.sh"] // This is the file list, we can put complicated commands to one script
}
The case developer should define the type, the hardware requirements and the ammount of the host opertation systems. Also, he/she should define the container image (by dockerfile for example), so the backend server will find/build an image.
"Requires": [
{
"class": "operationOS", //class, not an object
"type": "os", // only 'os' and 'container'
"distribution": "Ubuntu14.02",
"resource": {
"CPU": 1,
"Memory": "2GB",
"Disk": "100G"
}
"amount": 2 //how many hostOS do we need, no need if the 'type' is container
}
{
"class": "ImageA":
"type": "container",
"version": "dockerV1.0"
"file": "a.dockerfile"
}
],
The case developer should tell the host operation systems and the containers which commands should be used to deploy the test. The commands could be used directly or wrapped by a script. By default, after runing all the command, the test system will continue to the 'Run' part. If the developer want to install extra package, he/she can put the related commands here.
"Deploys": [
{
"object": "hostA",
"class": "OperationOS",
"setup": "null",
"containers": [
{
"object": "DockerA",
"class": "ImageA",
"deploy": {
"type": "script",
"name": "b.sh"
}
}
]
}
},
{
"object": "hostB",
"class": "OperationOS", //difference object, same class
"containers": [
{
"object": "DockerB",
"class": "ImageA",
"deploy": {
"type": "cmd", //if you don't want to use another script, put commands here
"commands": "systemctl start sshd"
}
}
]
}
}
],
The case developer should tell the host operation systems and the containers which commands should be used to run the test. The commands could be used directly or wrapped by a script. By default, after ruuning all the command, the test system will continue to the 'Collect' part.
"Run": [
{
"hostA": {
"run": null
}
},
{
"DockerA": {
"run": {
"type": "cmd",
"value": "ping -c 1 -s 1500 192.168.10.10"
}
}
}
]
The case developer should tell the host operation systems and/or the containers if there was any output file.
"Collect": [
{"DockerA": {
"file": "/tmp/dockerA/output.json" //this file will be return to our framework as the output
}
]