diff --git a/usr/share/lib/ipa/tests/SLES/Azure/conftest.py b/usr/share/lib/ipa/tests/SLES/Azure/conftest.py new file mode 100644 index 00000000..8eb82067 --- /dev/null +++ b/usr/share/lib/ipa/tests/SLES/Azure/conftest.py @@ -0,0 +1,14 @@ +import json +import pytest + + +@pytest.fixture() +def get_azure_billing_tag(host): + def f(): + result = host.run( + 'sudo azuremetadata --tag' + ) + + data = json.loads(result.stdout.strip()) + return data['billingTag'] + return f \ No newline at end of file diff --git a/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_billing_tag.py b/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_billing_tag.py new file mode 100644 index 00000000..e2504ac2 --- /dev/null +++ b/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_billing_tag.py @@ -0,0 +1,4 @@ + + +def test_sles_azure_billing_tag(get_azure_billing_tag): + assert get_azure_billing_tag() diff --git a/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_on_demand.yaml b/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_on_demand.yaml new file mode 100644 index 00000000..7ea9d80d --- /dev/null +++ b/usr/share/lib/ipa/tests/SLES/Azure/test_sles_azure_on_demand.yaml @@ -0,0 +1,2 @@ +tests: + - test_sles_azure_billing_tag