Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd-kola: transparently pass unknown flags to kola #1058

Merged
merged 1 commit into from
Jan 16, 2020
Merged
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
7 changes: 4 additions & 3 deletions src/cmd-kola
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ parser.add_argument("--basic-qemu-scenarios", help="Run the basic test across ue
parser.add_argument("--output-dir", help="Output directory")
parser.add_argument("subargs", help="Remaining arguments for kola", nargs='*',
default=['run'])
args = parser.parse_args()
args, unknown_args = parser.parse_known_args()

builds = Builds()
if args.build is None:
Expand Down Expand Up @@ -59,7 +59,7 @@ qemupath = os.path.join(builddir, qemuimg['path'])
# https://github.com/coreos/coreos-assembler/pull/85
kolaargs = ['kola']
bn = os.path.basename(qemupath)
if not any([x in args.subargs for x in ["-b", "--distro"]]):
if not any([x in unknown_args for x in ["-b", "--distro"]]):
if bn.startswith("rhcos-"):
kolaargs.extend(['-b', 'rhcos'])
else:
Expand All @@ -72,14 +72,15 @@ print(f"Using ignition version {ignition_version}")
if ignition_version == "2.2.0":
kolaargs.extend(["--ignition-version", "v2"])

if os.getuid() != 0 and not ('-p' in args.subargs):
if os.getuid() != 0 and not ('-p' in unknown_args):
kolaargs.extend(['-p', 'qemu-unpriv'])

# shellcheck disable=SC2086
kolaargs.extend(['--qemu-image', qemupath])
outputdir = args.output_dir or "tmp/kola"
kolaargs.extend(['--output-dir', outputdir])
kolaargs.extend(args.subargs)
kolaargs.extend(unknown_args)

kolaargs.extend(blacklist_args)

Expand Down