diff --git a/test/check-subscriptions b/test/check-subscriptions index c1931f9..a466694 100755 --- a/test/check-subscriptions +++ b/test/check-subscriptions @@ -31,15 +31,19 @@ import testvm # candlepin on the services image has a lot of demo data preloaded # useful info/commands: -# Login: doc password: password -# org: snowwhite +# login: huey +# password: password +# organizations: admin, snowwhite, donallduck # -# Login: admin password: admin -# org: admin +# login: duey +# password: password +# org: donaldduck +# +# of those, only the 'donaldduck' organization is in SCA mode # # product certificates are installed onto the test machine to make it possible # to use those products; few sample products are used in the tests, because of -# the different subscriptions for doc and admin, see the PRODUCT_* variables +# the different subscriptions for users, see the PRODUCT_* variables # # to use the candlepin image on a test machine, either add the certificate or # allow insecure connections (/etc/rhsm/rhsm.conf -> "insecure = 1") @@ -47,9 +51,9 @@ import testvm # $IP is the ip of the candlepin machine # # add an activation key to a pool: -# curl --insecure --request POST --user admin:admin \ +# curl --insecure --request POST --user huey:password \ # https://$IP:8443/candlepin/activation_keys/ff80808155ca50b10155ca50cd280010/pools/ff80808155ca50b10155ca51f04607e5 -# register with: activation key "awesome_os_pool" and org "admin" +# register with: activation key "awesome_os_pool" and org "donaldduck" # # in order to get the right ids for the activation key and pool, see # ACTIVATION_KEY_SCRIPT @@ -80,12 +84,12 @@ import sys import json import requests -data = requests.get(sys.argv[1] + "/activation_keys", auth=("admin", "admin")).json() +data = requests.get(sys.argv[1] + "/activation_keys", auth=("huey", "password")).json() key = [ e["id"] for e in data if e["name"] == "awesome_os_pool" and e["owner"]["displayName"] == "Admin Owner" ][0] -data = requests.get(sys.argv[1] + "/pools", auth=("admin", "admin")).json() +data = requests.get(sys.argv[1] + "/pools", auth=("huey", "password")).json() pool = [ e["id"] for e in data @@ -95,7 +99,7 @@ pool = [ ][0] key_url = sys.argv[1] + "/activation_keys/{key}/pools/{pool}".format(key=key, pool=pool) -requests.post(key_url, auth=("admin", "admin")) +requests.post(key_url, auth=("huey", "password")) """ # fmt: off @@ -224,7 +228,7 @@ class TestSubscriptions(SubscriptionsCase): # enter server and incorrect login data b.set_val("#subscription-register-url", "custom") b.set_input_text("#subscription-register-url-custom", CANDLEPIN_URL) - b.set_input_text("#subscription-register-username", "doc") + b.set_input_text("#subscription-register-username", "huey") b.set_input_text("#subscription-register-password", "wrongpass") # Do not try to connect to insights @@ -245,7 +249,7 @@ class TestSubscriptions(SubscriptionsCase): b.wait_not_in_text("body", "Invalid credentials") # wait for message that we need to specify our org - b.wait_in_text("body", "User doc is member of more organizations, but no organization was selected") + b.wait_in_text("body", "User huey is member of more organizations, but no organization was selected") # now specify the org b.set_input_text("#subscription-register-org", "snowwhite") @@ -256,7 +260,7 @@ class TestSubscriptions(SubscriptionsCase): # old error should disappear with b.wait_timeout(60): b.wait_not_in_text( - "body", "User doc is member of more organizations, but no organization was selected" + "body", "User huey is member of more organizations, but no organization was selected" ) # dialog should disappear @@ -296,7 +300,7 @@ class TestSubscriptions(SubscriptionsCase): # make sure we have an activation key on the target machine machine_python(self.machine, ACTIVATION_KEY_SCRIPT, CANDLEPIN_URL) b.set_input_text("#subscription-register-key", "awesome_os_pool") - b.set_input_text("#subscription-register-org", "admin") + b.set_input_text("#subscription-register-org", "donaldduck") dialog_register_button_sel = "footer .pf-m-primary" b.click(dialog_register_button_sel) @@ -320,42 +324,6 @@ class TestSubscriptions(SubscriptionsCase): # find another one that isn't subscribed too self.wait_subscription(PRODUCT_SHARED, False) - def testRegisterWithoutAutoAttach(self): - b = self.browser - - self.login_and_go("/subscriptions") - - # wait until we can open the registration dialog - register_button_sel = "button:contains('Register')" - b.click(register_button_sel) - - b.wait_visible("#subscription-register-url") - - # enter server and correct login data - b.set_val("#subscription-register-url", "custom") - b.set_input_text("#subscription-register-url-custom", CANDLEPIN_URL) - b.set_input_text("#subscription-register-username", "doc") - b.set_input_text("#subscription-register-password", "password") - b.set_input_text("#subscription-register-org", "snowwhite") - - b.click("#subscription-auto-attach-use") - - dialog_register_button_sel = "footer .pf-m-primary" - b.click(dialog_register_button_sel) - - # dialog should disappear - with b.wait_timeout(60): - b.wait_not_present(dialog_register_button_sel) - - # this product should not be subscribed ATM, because auto-attach was skipped - self.wait_subscription(PRODUCT_SHARED, False) - - b.click("button:contains('Auto-attach')") - - # find another one that is subscribed - with b.wait_timeout(60): - self.wait_subscription(PRODUCT_SHARED, True) - def testUnpriv(self): self.machine.execute("useradd junior; echo junior:foobar | chpasswd") self.login_and_go("/subscriptions", user="junior") @@ -376,9 +344,9 @@ class TestSubscriptions(SubscriptionsCase): b.set_val("#subscription-register-url", "custom") b.set_input_text("#subscription-register-url-custom", CANDLEPIN_URL) - b.set_input_text("#subscription-register-username", "admin") - b.set_input_text("#subscription-register-password", "admin") - b.set_input_text("#subscription-register-org", "admin") + b.set_input_text("#subscription-register-username", "huey") + b.set_input_text("#subscription-register-password", "password") + b.set_input_text("#subscription-register-org", "donaldduck") # Do not try to connect to insights b.set_checked("#subscription-insights", False) @@ -436,9 +404,9 @@ class TestSubscriptions(SubscriptionsCase): b.set_val("#subscription-register-url", "custom") b.set_input_text("#subscription-register-url-custom", CANDLEPIN_URL) - b.set_input_text("#subscription-register-username", "admin") - b.set_input_text("#subscription-register-password", "admin") - b.set_input_text("#subscription-register-org", "admin") + b.set_input_text("#subscription-register-username", "huey") + b.set_input_text("#subscription-register-password", "password") + b.set_input_text("#subscription-register-org", "donaldduck") b.set_checked("#subscription-insights", True) dialog_register_button_sel = "footer .pf-m-primary" b.click(dialog_register_button_sel) @@ -496,9 +464,9 @@ class TestSubscriptionsPackages(SubscriptionsCase, PackageCase): b.set_val("#subscription-register-url", "custom") b.set_input_text("#subscription-register-url-custom", CANDLEPIN_URL) - b.set_input_text("#subscription-register-username", "admin") - b.set_input_text("#subscription-register-password", "admin") - b.set_input_text("#subscription-register-org", "admin") + b.set_input_text("#subscription-register-username", "huey") + b.set_input_text("#subscription-register-password", "password") + b.set_input_text("#subscription-register-org", "donaldduck") b.set_checked("#subscription-insights", True) b.wait_visible('.pf-c-modal-box__body:contains("The insights-client package will be installed")') b.click("footer button.apply")