From 80dd997b9c43307f00c58491a3acd950049818f4 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 ec30c64b..7f8a7434 100644 --- a/src/composer/cli/compose.py +++ b/src/composer/cli/compose.py @@ -197,7 +197,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 8124b17c..1041a993 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 hyper-v live-iso liveimg-tar 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 hyper-v live-iso liveimg-tar 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 liveimg-tar openstack partitioned-disk qcow2 tar" + fi rlPhaseEnd rlPhaseStartTest "compose start"