diff --git a/integration-tests/test_unregister.py b/integration-tests/test_unregister.py index 88293167..a4169a84 100644 --- a/integration-tests/test_unregister.py +++ b/integration-tests/test_unregister.py @@ -1,3 +1,11 @@ +""" +:casecomponent: insights-client +:requirement: RHSS-291297 +:subsystemteam: sst_csi_client_tools +:caseautomation: Automated +:upstream: Yes +""" + import pytest import conftest @@ -5,9 +13,22 @@ def test_unregister(insights_client): - """Test insights-client --unregister after registering it - - If the unregistration is successful, `unregister` method returns True + """ + :id: ecaeeddc-4c8b-4f17-8d69-1c81d2c7c744 + :title: Test unregister + :description: + This test verifies that the insights-client can be unregistered + successfully after being registered. + :tier: Tier 1 + :steps: + 1. Register the insights-client if not registered + 2. Run `insights-client --unregister` command + 3. Confirm the client is unregistered + :expectedresults: + 1. The client registers successfully + 2. Command outputs "Successfully unregistered from the + Red Hat Insights Service". + 3. Client unregistration is confirmed """ insights_client.register() assert conftest.loop_until(lambda: insights_client.is_registered) @@ -21,10 +42,26 @@ def test_unregister(insights_client): def test_unregister_twice(insights_client): - """Test insights-client --unregister on unregistered system - If the unregistration is successful, `--unregister` returns True on first attempt - and false on subsequent attempts.""" - + """ + :id: bfff1b33-5f19-42d2-a6ff-4598975873e5 + :title: Test unregister already unregistered system + :description: + This test verifies that attempting to unregister the insights client + when it is already unregistered behaves as expected. It checks that + the first unregistration succeeds and that subsequent unregistration + attempts produce the appropriate error message and return code + :tier: Tier 1 + :steps: + 1. Register the insights-client + 2. Unregister the client for the first time + 3. Attempt to unregister the client a second time + :expectedresults: + 1. The client registers successfully + 2. Command outputs "Successfully unregistered from the + Red Hat Insights Service" + 3. Command returns exit code 1 and outputs "This host is not registered, + unregistration is not applicable." + """ insights_client.register() assert conftest.loop_until(lambda: insights_client.is_registered)