Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions item.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
class Item(item.ItemBase):
def run(self):
cmdline = 'virsh'
cmdline += ' %s' % utils.escape(str(self.get('subcmd')))
options = self.get('options')
cmdline += ' %s' % utils.escape(str(self.get('SubCMD')))
options = self.get('Options')
if options is not None:
for opt in options:
cmdline += ' --%s' % utils.escape(str(opt))
Expand Down
22 changes: 10 additions & 12 deletions oracles/virsh.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
- name: SubCMD
target: subcmd
tree: |
if self is NonEmptyBytes:
if self in virsh.commands():
return PASS()
oracle: |
if SubCMD is NonEmptyBytes:
if SubCMD in virsh.commands():
return SUCCESS()
else:
return FAIL("unknown command: .*")

- name: Options
target: options
assume: SubCMD is PASS
tree: |
if self is StringList:
if all(self in virsh.options(subcmd)):
if any(virsh.exclusive_options(subcmd) in self):
require: SubCMD is SUCCESS
oracle: |
if Options is StringList:
if all(Options in virsh.options(SubCMD)):
if any(virsh.exclusive_options(SubCMD) in Options):
return FAIL()
else:
return PASS()
return SUCCESS()
else:
return FAIL()