diff --git a/item.py b/item.py index 85c1f44..48a36ef 100644 --- a/item.py +++ b/item.py @@ -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)) diff --git a/oracles/virsh.yaml b/oracles/virsh.yaml index 489dd7a..e9fdb77 100644 --- a/oracles/virsh.yaml +++ b/oracles/virsh.yaml @@ -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()