Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:LegacyX86
virt-manager
092-cli-Use-regex-for-grep-and-nogrep-args.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 092-cli-Use-regex-for-grep-and-nogrep-args.patch of Package virt-manager
Subject: tests: cli: Use regex for grep= and nogrep= args From: Cole Robinson crobinso@redhat.com Tue Aug 6 10:33:38 2024 -0400 Date: Wed Aug 7 11:58:49 2024 -0400: Git: 0288e9258113f7db5b69c1eac00c2341a69875ff This will let us match more complex output, and match error message differences across libvirt versions Signed-off-by: Cole Robinson <crobinso@redhat.com> --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -6,6 +6,7 @@ import atexit import io import os +import re import shlex import shutil import sys @@ -341,10 +342,10 @@ class Command(object): _raise_error("Expected command to %s, but it didn't.\n" % (self.check_success and "pass" or "fail")) - if self.grep and self.grep not in output: - _raise_error("Didn't find grep=%s" % self.grep) - if self.nogrep and self.nogrep in output: - _raise_error("Found grep=%s when we shouldn't see it" % + if self.grep and not re.search(self.grep, output): + _raise_error("Didn't find regex grep=%s" % self.grep) + if self.nogrep and re.search(self.nogrep, output): + _raise_error("Found regex grep=%s when we shouldn't see it" % self.nogrep) if self.compare_file: @@ -949,7 +950,7 @@ c.add_invalid("--disk size=1 --file foob ################################################ c = vinst.add_category("invalid-devices", "--noautoconsole --nodisks --pxe --osinfo require=no") -c.add_invalid("--clock foo_tickpolicy=merge", grep="Unknown --clock options: ['foo_tickpolicy']") # Bad suboption +c.add_invalid("--clock foo_tickpolicy=merge", grep="Unknown --clock options:.*'foo_tickpolicy'") # Bad suboption c.add_invalid("--connect %(URI-TEST-FULL)s --host-device 1d6b:2", grep="corresponds to multiple node devices") c.add_invalid("--connect %(URI-TEST-FULL)s --host-device pci_8086_2850_scsi_host_scsi_host", grep="Unsupported node device type 'scsi_host'") # Unsupported hostdev type c.add_invalid("--host-device foobarhostdev", grep="Unknown hostdev address string format") # Unknown hostdev
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor