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
This commit is contained in:
Brian C. Lane 2019-12-10 11:34:42 -08:00
parent b6b842943d
commit 054669d027
2 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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"