From 054669d0275bc80ccfcdc63cfcc9946b419c723d Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 10 Dec 2019 11:34:42 -0800 Subject: [PATCH] composer-cli: Only display the available compose types The enabled bool is now being used so the cli should only show the types actually available on the architecture. Also modifies the test in test_compose_sanity.sh Related: rhbz#1751998 --- src/composer/cli/compose.py | 2 +- tests/cli/test_compose_sanity.sh | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/composer/cli/compose.py b/src/composer/cli/compose.py index 04655656..38aeb6fb 100644 --- a/src/composer/cli/compose.py +++ b/src/composer/cli/compose.py @@ -227,7 +227,7 @@ def compose_types(socket_path, api_version, args, show_json=False, testmode=0): return 0 # output a plain list of identifiers, one per line - print("\n".join(t["name"] for t in result["types"])) + print("\n".join(t["name"] for t in result["types"] if t["enabled"])) def compose_start(socket_path, api_version, args, show_json=False, testmode=0): """Start a new compose using the selected blueprint and type diff --git a/tests/cli/test_compose_sanity.sh b/tests/cli/test_compose_sanity.sh index 56140c42..7a798597 100755 --- a/tests/cli/test_compose_sanity.sh +++ b/tests/cli/test_compose_sanity.sh @@ -11,8 +11,14 @@ CLI="${CLI:-./src/bin/composer-cli}" rlJournalStart rlPhaseStartTest "compose types" - rlAssertEquals "lists all supported types" \ - "`$CLI compose types | xargs`" "alibaba ami ext4-filesystem google live-iso openstack partitioned-disk qcow2 tar vhd vmdk" + if [ "$(uname -m)" = "x86_64" ]; then + rlAssertEquals "lists all supported types" \ + "`$CLI compose types | xargs`" "alibaba ami ext4-filesystem google live-iso openstack partitioned-disk qcow2 tar vhd vmdk" + else + # non-x86 architectures disable alibaba + rlAssertEquals "lists all supported types" \ + "`$CLI compose types | xargs`" "ext4-filesystem live-iso openstack partitioned-disk qcow2 tar" + fi rlPhaseEnd rlPhaseStartTest "compose start"