add multi-app examples

This commit is contained in:
rhythmcao
2024-01-30 11:32:36 +08:00
parent cb7643713e
commit 2df7de25ab
8 changed files with 246 additions and 60 deletions

View File

@@ -36,7 +36,8 @@
"parameters": {
"command": [
"gnome-terminal",
"--maximize"
"--maximize",
"--working-directory=/home/user/"
]
}
}
@@ -59,43 +60,27 @@
}
}
],
"func": ["check_include_exclude", "check_include_exclude"],
"conj": "and",
"result": [
{
"type": "vm_command_line",
"command": [
"/bin/bash",
"-c",
"output=$(ps aux | grep \"[s]office\"]); if [ -z \"$output\" ]; then echo \"true\"; else echo \"false\"; fi"
]
},
{
"type": "vm_command_line",
"command": [
"/bin/bash",
"-c",
"output=$(cat ~/.bash_history | grep \"[k]ill\"); if [ -z \"$output\" ]; then echo \"false\"; else echo \"true\"; fi"
"func": "check_include_exclude",
"result": {
"type": "vm_command_line",
"command": [
"/bin/bash",
"-c",
"output=$(ps aux | grep \"[s]office\"]); if [ -z \"$output\" ]; then echo \"no libreoffice is running\"; else echo \"libreoffice is still running\"; fi; output=$(cat ~/.bash_history | grep \"[k]ill\"); if [ -z \"$output\" ]; then echo \"not killed from terminal\"; else echo \"killed from terminal\"; fi"
]
},
"expected": {
"type": "rule",
"rules": {
"include": [
"no libreoffice is running",
"killed from terminal"
],
"exclude": [
"libreoffice is still running",
"not killed from terminal"
]
}
],
"expected": [
{
"type": "rule",
"rules": {
"include": [
"true\n"
]
}
},
{
"type": "rule",
"rules": {
"include": [
"true\n"
]
}
}
]
}
}
}