Search in sources :

Example 81 with BugzillaAPIException

use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.

the class ActivationKeyTests method testRegisterWithActivationKeyContainingPoolWithQuantity.

/**
 * @param blockedByBug
 * @param keyName
 * @param jsonPool
 * @param addQuantity
 * @return If an attempt to register with the proposed activation key (made with the given keyName, jsonPool, and addQuantity) is made, then the result from the register is returned.  If no attempt is made, then null is returned.
 * @throws JSONException
 * @throws Exception
 */
@// update=true,	// uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-47896", "RHEL7-96498" }, linkedWorkItems = { @LinkedItem(// RHSM-REQ : subscription-manager cli registration and deregistration
workitemId = "RHEL6-28485", project = Project.RHEL6, role = DefTypes.Role.VERIFIES), @LinkedItem(// RHSM-REQ : subscription-manager cli registration and deregistration
workitemId = "RHEL7-84906", project = Project.RedHatEnterpriseLinux7, role = DefTypes.Role.VERIFIES) }, level = DefTypes.Level.COMPONENT, component = "subscription-manager", testtype = @TestType(testtype = DefTypes.TestTypes.FUNCTIONAL, subtype1 = DefTypes.Subtypes.RELIABILITY, subtype2 = DefTypes.Subtypes.EMPTY), posneg = PosNeg.POSITIVE, importance = DefTypes.Importance.HIGH, automation = DefTypes.Automation.AUTOMATED, tags = "Tier3")
@Test(description = "create an activation key, add a pool to it with a quantity, and then register with the activation key (include variations on valid/invalid quantities)", groups = { "Tier3Tests", "blockedByBug-973838" }, dataProvider = "getRegisterWithActivationKeyContainingPoolWithQuantityData", enabled = true)
public // @ImplementsNitrateTest(caseId=)
SSHCommandResult testRegisterWithActivationKeyContainingPoolWithQuantity(Object blockedByBug, String keyName, JSONObject jsonPool, Integer addQuantity) throws JSONException, Exception {
    // if (!jsonPool.getString("productId").equals("awesomeos-virt-4")) throw new SkipException("debugging...");
    // if (jsonPool.getInt("quantity")!=-1) throw new SkipException("debugging...");
    // if (!jsonPool.getString("productId").equals("awesomeos-virt-unlimited")) throw new SkipException("debugging...");
    String poolId = jsonPool.getString("id");
    // TEMPORARY WORKAROUND FOR BUG: https://bugzilla.redhat.com/show_bug.cgi?id=728721 - jsefler 8/6/2011
    if (CandlepinTasks.isPoolProductConsumableByConsumerType(sm_clientUsername, sm_clientPassword, sm_serverUrl, poolId, ConsumerType.person)) {
        boolean invokeWorkaroundWhileBugIsOpen = true;
        String bugId = "728721";
        try {
            if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
                log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
                SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
            } else {
                invokeWorkaroundWhileBugIsOpen = false;
            }
        } catch (BugzillaAPIException be) {
        /* ignore exception */
        } catch (RuntimeException re) {
        /* ignore exception */
        }
        if (invokeWorkaroundWhileBugIsOpen) {
            throw new SkipException("Skipping this test while bug '" + bugId + "' is open. (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
        }
    }
    // END OF WORKAROUND
    // generate a unique activation key name for this test
    // String keyName = String.format("ActivationKey%s_ForPool%s", System.currentTimeMillis(), poolId);
    // create a JSON object to represent the request body
    Map<String, String> mapActivationKeyRequest = new HashMap<String, String>();
    mapActivationKeyRequest.put("name", keyName);
    JSONObject jsonActivationKeyRequest = new JSONObject(mapActivationKeyRequest);
    // call the candlepin api to create an activation key
    JSONObject jsonActivationKey = new JSONObject(CandlepinTasks.postResourceUsingRESTfulAPI(sm_clientUsername, sm_clientPassword, sm_serverUrl, "/owners/" + sm_clientOrg + "/activation_keys", jsonActivationKeyRequest.toString()));
    Assert.assertEquals(jsonActivationKey.getString("name"), keyName, "Activation key creation attempt appears successful.  Activation key: " + jsonActivationKey);
    // add the pool with a random available quantity (?quantity=#) to the activation key
    int quantityAvail = jsonPool.getInt("quantity") - jsonPool.getInt("consumed");
    JSONObject jsonResult = new JSONObject(CandlepinTasks.postResourceUsingRESTfulAPI(sm_clientUsername, sm_clientPassword, sm_serverUrl, "/activation_keys/" + jsonActivationKey.getString("id") + "/pools/" + poolId + (addQuantity == null ? "" : "?quantity=" + addQuantity), null));
    // if (clienttasks.isVersion(servertasks.statusVersion, ">", "0.9.30-1")) the POST now returns the jsonActivationKey and formerly returned the jsonPoolAddedToActivationKey	// candlepin commit 82b9af5dc2c63b58447366e680fcf6f156c6049f
    if (addQuantity == null) {
    // addQuantity=1;	// this was true before Bug 1023568 - [RFE] bind requests using activation keys that do not specify a quantity should automatically use the quantity needed to achieve compliance
    }
    // handle the case when the pool productAttributes contain name:"requires_consumer_type" value:"person"
    if (ConsumerType.person.toString().equals(CandlepinTasks.getPoolProductAttributeValue(sm_clientUsername, sm_clientPassword, sm_serverUrl, poolId, "requires_consumer_type"))) {
        // assert that the adding of the pool to the key was NOT successful (contains a displayMessage from some thrown exception)
        if (jsonResult.has("displayMessage")) {
            String displayMessage = jsonResult.getString("displayMessage");
            // Assert.assertEquals(displayMessage,"Pools requiring a 'person' consumer should not be added to an activation key since a consumer type of 'person' cannot be used with activation keys","Expected the addition of a requires consumer type person pool '"+poolId+"' to activation key named '"+keyName+"' with quantity '"+addQuantity+"' to be blocked.");
            Assert.assertEquals(displayMessage, "Cannot add pools restricted to consumer type 'person' to activation keys.", "Expected the addition of a requires consumer type person pool '" + poolId + "' to activation key named '" + keyName + "' with quantity '" + addQuantity + "' to be blocked.");
        } else {
            log.warning("The absense of a displayMessage indicates the activation key creation was probably successful when we expected it to fail since we should be blocked from adding pools that require consumer type person to an activation key.");
            Assert.assertFalse(keyName.equals(jsonActivationKey.getString("name")), "Pool '" + poolId + "' which requires a consumer type 'person' should NOT have been added to the following activation key with any quantity: " + jsonActivationKey);
        }
        return null;
    }
    // handle the case when the pool is NOT multi_entitlement and we tried to add the pool to the key with a quantity > 1
    if (!CandlepinTasks.isPoolProductMultiEntitlement(sm_clientUsername, sm_clientPassword, sm_serverUrl, poolId) && addQuantity != null && addQuantity > 1) {
        // assert that the adding of the pool to the key was NOT successful (contains a displayMessage from some thrown exception)
        if (jsonResult.has("displayMessage")) {
            String displayMessage = jsonResult.getString("displayMessage");
            Assert.assertEquals(displayMessage, "Error: Only pools with multi-entitlement product subscriptions can be added to the activation key with a quantity greater than one.", "Expected the addition of a non-multi-entitlement pool '" + poolId + "' to activation key named '" + keyName + "' with quantity '" + addQuantity + "' to be blocked.");
        } else {
            log.warning("The absense of a displayMessage indicates the activation key creation was probably successful when we expected it to fail due to greater than one quantity '" + addQuantity + "'.");
            Assert.assertFalse(keyName.equals(jsonActivationKey.getString("name")), "Non multi-entitlement pool '" + poolId + "' should NOT have been added to the following activation key with a quantity '" + addQuantity + "' greater than one: " + jsonActivationKey);
        }
        return null;
    }
    // handle the case when the quantity is excessive
    if (addQuantity != null && addQuantity > jsonPool.getInt("quantity") && addQuantity > 1) {
        String expectedDisplayMessage = "The quantity must not be greater than the total allowed for the pool";
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "0.9.37-1")) {
            // commit 3cdb39430c86de141405e815a2a428ad64b1c220	// Removed rules for activation key creation. Relaxation of activation key rules at register time means the keys can have many more differing pools at create time
            // new relaxed behavior
            log.warning("Prior to candlepin commit 3cdb39430c86de141405e815a2a428ad64b1c220, this test asserted that candlepin attempts to create an activation key that attached a pool quantity exceeding its total pool size would be blocked.  This is now relaxed.  QE believes that this will cause usability issues.");
            Assert.assertFalse(jsonResult.has("displayMessage"), "After candlepin-common-1.0.17-1, attempts to create an activation key that attached a pool quantity exceeding its total pool size are permitted.  QE believes that this will cause usability issues.");
        } else {
            // assert that adding the pool to the key was NOT successful (contains a displayMessage)
            if (jsonResult.has("displayMessage")) {
                String displayMessage = jsonResult.getString("displayMessage");
                Assert.assertEquals(displayMessage, expectedDisplayMessage, "Expected the addition of multi-entitlement pool '" + poolId + "' to activation key named '" + keyName + "' with an excessive quantity '" + addQuantity + "' to be blocked.");
            } else {
                log.warning("The absense of a displayMessage indicates the activation key creation was probably successful when we expected it to fail due to an excessive quantity '" + addQuantity + "'.");
                Assert.assertFalse(keyName.equals(jsonActivationKey.getString("name")), "Pool '" + poolId + "' should NOT have been added to the following activation key with an excessive quantity '" + addQuantity + "': " + jsonActivationKey);
            }
            return null;
        }
    }
    // handle the case when the quantity is insufficient (less than one)
    if (addQuantity != null && addQuantity < 1) {
        // assert that adding the pool to the key was NOT successful (contains a displayMessage)
        if (jsonResult.has("displayMessage")) {
            String displayMessage = jsonResult.getString("displayMessage");
            Assert.assertEquals(displayMessage, "The quantity must be greater than 0", "Expected the addition of pool '" + poolId + "' to activation key named '" + keyName + "' with quantity '" + addQuantity + "' less than one be blocked.");
        } else {
            log.warning("The absense of a displayMessage indicates the activation key creation was probably successful when we expected it to fail due to insufficient quantity '" + addQuantity + "'.");
            Assert.assertFalse(keyName.equals(jsonActivationKey.getString("name")), "Pool '" + poolId + "' should NOT have been added to the following activation key with insufficient quantity '" + addQuantity + "': " + jsonActivationKey);
        }
        return null;
    }
    // assert the pool is added
    jsonActivationKey = new JSONObject(CandlepinTasks.getResourceUsingRESTfulAPI(sm_serverAdminUsername, sm_serverAdminPassword, sm_serverUrl, "/activation_keys/" + jsonActivationKey.getString("id")));
    String addedPoolId = null;
    if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "2.0.12-1")) {
        // candlepin commit a868d9706b722cb548d697854c42e7de97a3ec9b Added a DTO for activation keys
        // [root@jsefler-rhel7 ~]# curl --stderr /dev/null --insecure --user admin:admin --request GET https://jsefler-candlepin.usersys.redhat.com:8443/candlepin/activation_keys/8a90860f54ce9e030154ceef3f2010b6 | python -m json/tool
        // {
        // "autoAttach": null,
        // "contentOverrides": [],
        // "created": "2016-05-20T16:11:06+0000",
        // "description": null,
        // "id": "8a90860f54ce9e030154ceef3f2010b6",
        // "name": "ActivationKey1463760627557_ForPool8a90860f54ce9e030154ce9faf820933_Quantity2",
        // "owner": {
        // "displayName": "Admin Owner",
        // "href": "/owners/admin",
        // "id": "8a90860f54ce9e030154ce9f136c0002",
        // "key": "admin"
        // },
        // "pools": [
        // {
        // "poolId": "8a90860f54ce9e030154ce9faf820933",
        // "quantity": 2
        // }
        // ],
        // "products": [],
        // "releaseVer": {
        // "releaseVer": null
        // },
        // "serviceLevel": null,
        // "updated": "2016-05-20T16:11:06+0000"
        // }
        // get(0) since there should only be one pool added
        addedPoolId = ((JSONObject) jsonActivationKey.getJSONArray("pools").get(0)).getString("poolId");
    } else {
        // # curl -k -u admin:admin https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/activation_keys/8a90f8c63196bb2001319f66afa83cb4 | python -mjson.tool
        // {
        // "created": "2011-08-06T14:02:12.264+0000",
        // "id": "8a90f8c63196bb2001319f66afa83cb4",
        // "name": "ActivationKey1312639332183_ForPool8a90f8c63196bb20013196bc7f6302dc",
        // "owner": {
        // "displayName": "Admin Owner",
        // "href": "/owners/admin",
        // "id": "8a90f8c63196bb20013196bb9e210006",
        // "key": "admin"
        // },
        // "pools": [
        // {
        // "created": "2011-08-06T14:02:12.419+0000",
        // "id": "8a90f8c63196bb2001319f66b0433cb6",
        // "pool": {
        // "href": "/pools/8a90f8c63196bb20013196bc7f6302dc",
        // "id": "8a90f8c63196bb20013196bc7f6302dc"
        // },
        // "quantity": 1,
        // "updated": "2011-08-06T14:02:12.419+0000"
        // }
        // ],
        // "updated": "2011-08-06T14:02:12.264+0000"
        // }
        // get(0) since there should only be one pool added
        addedPoolId = ((JSONObject) jsonActivationKey.getJSONArray("pools").get(0)).getJSONObject("pool").getString("id");
    }
    Assert.assertEquals(addedPoolId, poolId, "Pool id '" + poolId + "' appears to be successfully added to activation key: " + jsonActivationKey);
    if (addQuantity != null) {
        // get(0) since there should only be one pool added
        Integer addedQuantity = ((JSONObject) jsonActivationKey.getJSONArray("pools").get(0)).getInt("quantity");
        Assert.assertEquals(addedQuantity, addQuantity, "Pool id '" + poolId + "' appears to be successfully added with quantity '" + addQuantity + "' to activation key: " + jsonActivationKey);
    } else {
        // only possible after Bug 1023568 - [RFE] bind requests using activation keys that do not specify a quantity should automatically use the quantity needed to achieve compliance
        Assert.assertTrue(((JSONObject) jsonActivationKey.getJSONArray("pools").get(0)).isNull("quantity"), "Pool id '" + poolId + "' appears to be successfully added with a null quantity to activation key: " + jsonActivationKey);
    }
    // register with the activation key
    SSHCommandResult registerResult = clienttasks.register_(null, null, sm_clientOrg, null, null, null, null, null, null, null, jsonActivationKey.getString("name"), null, null, null, true, null, null, null, null, null);
    // handle the case when "Consumers of this type are not allowed to subscribe to the pool with id '"+poolId+"'."
    ConsumerType activationkeyPoolRequiresConsumerType = null;
    if (!CandlepinTasks.isPoolProductConsumableByConsumerType(sm_clientUsername, sm_clientPassword, sm_serverUrl, poolId, ConsumerType.system)) {
        String expectedStderr = String.format("Consumers of this type are not allowed to subscribe to the pool with id '%s'.", poolId);
        if (!clienttasks.workaroundForBug876764(sm_serverType))
            expectedStderr = String.format("Units of this type are not allowed to attach the pool with ID '%s'.", poolId);
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">", "0.9.30-1")) {
            log.info("Prior to candlepin version 0.9.30-1, the expected feedback was: " + expectedStderr);
            // Follows: candlepin-0.9.30-1	// https://github.com/candlepin/candlepin/commit/bcb4b8fd8ee009e86fc9a1a20b25f19b3dbe6b2a
            expectedStderr = "No activation key was applied successfully.";
        }
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "2.2.0-1")) {
            // candlepin commit 08bcd6829cb4c89f737b8b77cbfdb85600a47933   bug 1440924: Adjust message when activation key registration fails
            log.info("Prior to candlepin version 2.2.0-1 , the expected feedback was: " + expectedStderr);
            expectedStderr = "None of the subscriptions on the activation key were available for attaching.";
        }
        Integer expectedExitCode = new Integer(255);
        // EX_SOFTWARE	// post commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))
            expectedExitCode = new Integer(70);
        Assert.assertEquals(registerResult.getStderr().trim(), expectedStderr, "Registering a system consumer using an activationKey containing a pool that requires a non-system consumer type should fail.");
        Assert.assertEquals(registerResult.getExitCode(), expectedExitCode, "The exitCode from registering a system consumer using an activationKey containing a pool that requires a non-system consumer type should fail.");
        // make sure there is no consumer cert - register with activation key should be 100% successful - if any one part fails, the whole operation fails
        Assert.assertNull(clienttasks.getCurrentConsumerCert(), "There should be no consumer cert on the system when register with activation key fails.");
        // now register with the same activation key using the needed ConsumerType
        activationkeyPoolRequiresConsumerType = ConsumerType.valueOf(CandlepinTasks.getPoolProductAttributeValue(sm_clientUsername, sm_clientPassword, sm_serverUrl, poolId, "requires_consumer_type"));
        registerResult = clienttasks.register_(null, null, sm_clientOrg, null, activationkeyPoolRequiresConsumerType, null, null, null, null, null, jsonActivationKey.getString("name"), null, null, null, false, /*was already unregistered by force above*/
        null, null, null, null, null);
        if (activationkeyPoolRequiresConsumerType != null) {
            if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.20.2-1")) {
                // post commit e0c34a729e9e347ab1e0f4f5fa656c8b20205fdf RFE Bug 1461003: Deprecate --type option on register command
                expectedStderr = "Error: The --type option has been deprecated and may not be used.";
                expectedExitCode = new Integer(64);
                Assert.assertEquals(registerResult.getStderr().trim(), expectedStderr, "Registering a system consumer using an activationKey containing a pool that requires a non-system consumer type should fail.");
                Assert.assertEquals(registerResult.getExitCode(), expectedExitCode, "The exitCode from registering a system consumer using an activationKey containing a pool that requires a non-system consumer type should fail.");
                throw new SkipException("Due to RFE Bug 1461003, subscription-manager can no longer register with --type which prevents registration using an --activationkey for a pool that has attribute \"requires_consumer_type\":\"" + activationkeyPoolRequiresConsumerType + "\"");
            }
        }
    }
    // resolution to: Bug 728721 - NullPointerException thrown when registering with an activation key bound to a pool that requires_consumer_type person
    if (ConsumerType.person.equals(activationkeyPoolRequiresConsumerType)) {
        Assert.assertEquals(registerResult.getStderr().trim(), "A consumer type of 'person' cannot be used with activation keys", "Registering with an activationKey containing a pool that requires_consumer_type=person should fail.");
        Assert.assertEquals(registerResult.getExitCode(), Integer.valueOf(255), "The exitCode from registering with an activationKey containing a pool that requires a person consumer should fail.");
        // make sure there is no consumer cert - register with activation key should be 100% successful - if any one part fails, the whole operation fails
        Assert.assertNull(clienttasks.getCurrentConsumerCert(), "There should be no consumer cert on the system when register with activation key fails.");
        Assert.assertEquals(clienttasks.getCurrentlyConsumedProductSubscriptions().size(), 0, "No subscriptions should be consumed after attempting to register with an activationKey containing a pool that requires a person consumer type.");
        return registerResult;
    }
    // handle the case when our quantity request exceeds the quantityAvail (when pool quantity is NOT unlimited)
    if ((addQuantity != null) && (addQuantity > quantityAvail) && (jsonPool.getInt("quantity") != -1)) {
        // Assert.assertEquals(registerResult.getStderr().trim(), String.format("No entitlements are available from the pool with id '%s'.",poolId), "Registering with an activationKey containing a pool for which not enough entitlements remain should fail.");	// expected string changed by bug 876758
        String expectedStderr = String.format("No subscriptions are available from the pool with id '%s'.", poolId);
        if (!clienttasks.workaroundForBug876764(sm_serverType))
            expectedStderr = String.format("No subscriptions are available from the pool with ID '%s'.", poolId);
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "2.3.1-1")) {
            // commit 0d5fefcfa8c1c2485921d2dee6633879b1e06931 Correct incorrect punctuation in user messages
            expectedStderr = String.format("No subscriptions are available from the pool with ID \"%s\".", poolId);
        }
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">", "0.9.30-1")) {
            log.info("Prior to candlepin version 0.9.30-1, the expected feedback was: " + expectedStderr);
            // Follows: candlepin-0.9.30-1	// https://github.com/candlepin/candlepin/commit/bcb4b8fd8ee009e86fc9a1a20b25f19b3dbe6b2a
            expectedStderr = "No activation key was applied successfully.";
        }
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "2.2.0-1")) {
            // candlepin commit 08bcd6829cb4c89f737b8b77cbfdb85600a47933   bug 1440924: Adjust message when activation key registration fails
            log.info("Prior to candlepin version 2.2.0-1 , the expected feedback was: " + expectedStderr);
            expectedStderr = "None of the subscriptions on the activation key were available for attaching.";
        }
        Integer expectedExitCode = new Integer(255);
        // EX_SOFTWARE	// post commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))
            expectedExitCode = new Integer(70);
        Assert.assertEquals(registerResult.getStderr().trim(), expectedStderr, "Registering with an activationKey containing a pool for which not enough entitlements remain should fail.");
        Assert.assertEquals(registerResult.getExitCode(), expectedExitCode, "The exitCode from registering with an activationKey containing a pool for which not enough entitlements remain should fail.");
        // make sure there is no consumer cert - register with activation key should be 100% successful - if any one part fails, the whole operation fails
        Assert.assertNull(clienttasks.getCurrentConsumerCert(), "There should be no consumer cert on the system when register with activation key fails.");
        return registerResult;
    }
    // handle the case when our candlepin is standalone and we have attempted a subscribe to a pool_derived virt_only pool (for which we have not registered our host system)
    if (servertasks.statusStandalone) {
        String pool_derived = CandlepinTasks.getPoolAttributeValue(jsonPool, "pool_derived");
        String virt_only = CandlepinTasks.getPoolAttributeValue(jsonPool, "virt_only");
        if (pool_derived != null && virt_only != null && Boolean.valueOf(pool_derived) && Boolean.valueOf(virt_only)) {
            // TEMPORARY WORKAROUND FOR BUG: https://bugzilla.redhat.com/show_bug.cgi?id=756628
            boolean invokeWorkaroundWhileBugIsOpen = true;
            String bugId = "756628";
            try {
                if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
                    log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
                    SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
                } else {
                    invokeWorkaroundWhileBugIsOpen = false;
                }
            } catch (BugzillaAPIException be) {
            /* ignore exception */
            } catch (RuntimeException re) {
            /* ignore exception */
            }
            if (invokeWorkaroundWhileBugIsOpen) {
                // 201111232226:08.420 - FINE: ssh root@jsefler-onprem-5server.usersys.redhat.com subscription-manager register --org=admin --activationkey=ActivationKey1322105167469_ForPool8a90f85733d31add0133d337f9410c52 --force
                // 201111232226:10.299 - FINE: Stdout: The system with UUID bd0271b6-2a0c-41b5-bbb8-df0ad4c7a088 has been unregistered
                // 201111232226:10.299 - FINE: Stderr: Unable to entitle consumer to the pool with id '8a90f85733d31add0133d337f9410c52'.: virt.guest.host.does.not.match.pool.owner
                // 201111232226:10.300 - FINE: ExitCode: 255
                Assert.assertTrue(registerResult.getStderr().trim().startsWith("Unable to entitle consumer to the pool with id '" + poolId + "'."), "Expected stderr to start with: \"Unable to entitle consumer to the pool with id '" + poolId + "'.\" because the host has not registered.");
                Assert.assertEquals(registerResult.getExitCode(), Integer.valueOf(255), "The exitCode from registering with an activationKey containing a virt_only derived_pool on a standalone candlepin server for which our system's host is not registered.");
                // make sure there is no consumer cert - register with activation key should be 100% successful - if any one part fails, the whole operation fails
                Assert.assertNull(clienttasks.getCurrentConsumerCert(), "There should be no consumer cert on the system when register with activation key fails.");
                return registerResult;
            }
            // 201112021710:31.299 - FINE: ExitCode: 255
            if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, "<", "0.9.45-1")) {
                // valid prior to the pools of "type": "UNMAPPED_GUEST"
                Assert.assertEquals(registerResult.getStderr().trim(), "Guest's host does not match owner of pool: '" + poolId + "'.");
                Assert.assertEquals(registerResult.getExitCode(), Integer.valueOf(255), "The exitCode from registering with an activationKey containing a virt_only derived_pool on a standalone candlepin server for which our system's host is not registered.");
                // make sure there is no consumer cert - register with activation key should be 100% successful - if any one part fails, the whole operation fails
                Assert.assertNull(clienttasks.getCurrentConsumerCert(), "There should be no consumer cert on the system when register with activation key fails.");
                return registerResult;
            } else {
            // TODO beyond the scope of this test, we could assert that the consumed subscription details match...
            // Status Details:      Guest has not been reported on any host and is using a temporary unmapped guest subscription.
            // [root@jsefler-os6 ~]# subscription-manager list --consumed
            // +-------------------------------------------+
            // Consumed Subscriptions
            // +-------------------------------------------+
            // Subscription Name:   Awesome OS Instance Based (Standard Support)
            // Provides:            Awesome OS Instance Server Bits
            // SKU:                 awesomeos-instancebased
            // Contract:            0
            // Account:             12331131231
            // Serial:              4452426557824085674
            // Pool ID:             ff8080814d6d978a014d6d98c5f41aaa
            // Provides Management: No
            // Active:              True
            // Quantity Used:       1
            // Service Level:       Standard
            // Service Type:        L1-L3
            // Status Details:      Guest has not been reported on any host and is using a temporary unmapped guest subscription.
            // Subscription Type:   Instance Based (Temporary)
            // Starts:              05/18/2015
            // Ends:                05/20/2015
            // System Type:         Virtual
            }
        }
    }
    // handle the case when the pool is restricted to a system that is not the same type as the pool
    boolean isSystemVirtual = Boolean.valueOf(clienttasks.getFactValue("virt.is_guest"));
    if (isSystemVirtual && CandlepinTasks.isPoolRestrictedToPhysicalSystems(sm_clientUsername, sm_clientPassword, sm_serverUrl, poolId)) {
        String expectedStderr = "Pool is restricted to physical systems: '" + poolId + "'.";
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">", "0.9.30-1")) {
            log.info("Prior to candlepin version 0.9.30-1, the expected feedback was: " + expectedStderr);
            // Follows: candlepin-0.9.30-1	// https://github.com/candlepin/candlepin/commit/bcb4b8fd8ee009e86fc9a1a20b25f19b3dbe6b2a
            expectedStderr = "No activation key was applied successfully.";
        }
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "2.2.0-1")) {
            // candlepin commit 08bcd6829cb4c89f737b8b77cbfdb85600a47933   bug 1440924: Adjust message when activation key registration fails
            log.info("Prior to candlepin version 2.2.0-1 , the expected feedback was: " + expectedStderr);
            expectedStderr = "None of the subscriptions on the activation key were available for attaching.";
        }
        Integer expectedExitCode = new Integer(255);
        // EX_SOFTWARE	// post commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))
            expectedExitCode = new Integer(70);
        Assert.assertEquals(registerResult.getStderr().trim(), expectedStderr, "Expected feedback when pool is restricted to physical systems.");
        Assert.assertEquals(registerResult.getExitCode(), expectedExitCode, "The exitCode from registering with an activationKey containing a physical_only pool while the registering system is virtual.");
        return registerResult;
    }
    if (!isSystemVirtual && CandlepinTasks.isPoolRestrictedToVirtualSystems(sm_clientUsername, sm_clientPassword, sm_serverUrl, poolId)) {
        String expectedStderr = "Pool is restricted to virtual guests: '" + poolId + "'.";
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">", "0.9.30-1")) {
            log.info("Prior to candlepin version 0.9.30-1, the expected feedback was: " + expectedStderr);
            // Follows: candlepin-0.9.30-1	// https://github.com/candlepin/candlepin/commit/bcb4b8fd8ee009e86fc9a1a20b25f19b3dbe6b2a
            expectedStderr = "No activation key was applied successfully.";
        }
        if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "2.2.0-1")) {
            // candlepin commit 08bcd6829cb4c89f737b8b77cbfdb85600a47933   bug 1440924: Adjust message when activation key registration fails
            log.info("Prior to candlepin version 2.2.0-1 , the expected feedback was: " + expectedStderr);
            expectedStderr = "None of the subscriptions on the activation key were available for attaching.";
        }
        Integer expectedExitCode = new Integer(255);
        // EX_SOFTWARE	// post commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))
            expectedExitCode = new Integer(70);
        Assert.assertEquals(registerResult.getStderr().trim(), expectedStderr, "Expected feedback when pool is restricted to virtual guests.");
        Assert.assertEquals(registerResult.getExitCode(), expectedExitCode, "The exitCode from registering with an activationKey containing a virt_only pool while the registering system is physical.");
        return registerResult;
    }
    // TEMPORARY WORKAROUND FOR BUG: 1183122 - rhsmd/subman dbus traceback on 'attach --pool'
    if (registerResult.getStderr().contains("KeyError: 'product_id'")) {
        boolean invokeWorkaroundWhileBugIsOpen = true;
        String bugId = "1183122";
        try {
            if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
                log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
                SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
            } else {
                invokeWorkaroundWhileBugIsOpen = false;
            }
        } catch (BugzillaAPIException be) {
        /* ignore exception */
        } catch (RuntimeException re) {
        /* ignore exception */
        }
        if (invokeWorkaroundWhileBugIsOpen) {
            log.warning("Encountered bug '" + bugId + "'. Skipping stderr assertion from the prior register with activationkey command while bug '" + bugId + "' is open.");
        }
    } else
        // Assert.assertEquals(registerResult.getStderr().trim(), "");
        // END OF WORKAROUND
        // assert success
        Assert.assertEquals(registerResult.getStderr().trim(), "");
    // Assert.assertNotSame(registerResult.getExitCode(), Integer.valueOf(255), "The exit code from the register command does not indicate a failure.");
    Assert.assertTrue(registerResult.getExitCode() <= 1, "The exit code from the register command does not indicate a failure.");
    // assert that only the pool's providedProducts (excluding type=MKT products) are consumed (unless it is a ManagementAddOn product - indicated by no providedProducts)
    assertProvidedProductsFromPoolAreWithinConsumedProductSubscriptionsUsingQuantity(jsonPool, clienttasks.getCurrentlyConsumedProductSubscriptions(), addQuantity, true);
    // assert that the YumRepos immediately reflect the entitled contentNamespace labels // added for the benefit of Bug 973838 - subscription-manager needs to refresh redhat.repo when registering against katello
    verifyCurrentEntitlementCertsAreReflectedInCurrentlySubscribedYumRepos(clienttasks.getCurrentProductCerts());
    return registerResult;
}
Also used : JSONObject(org.json.JSONObject) HashMap(java.util.HashMap) SSHCommandResult(com.redhat.qe.tools.SSHCommandResult) SkipException(org.testng.SkipException) BugzillaAPIException(com.redhat.qe.auto.bugzilla.BugzillaAPIException) ConsumerType(rhsm.base.ConsumerType) TestDefinition(com.github.redhatqe.polarize.metadata.TestDefinition) Test(org.testng.annotations.Test)

Example 82 with BugzillaAPIException

use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.

the class BrandingTests method getEligibleBrandNamesFromCurrentEntitlementCerts.

/**
 * @param entitlementCerts TODO
 * @return the eligible brand names based on the current entitlement certs and the currently installed product certs
 */
Set<String> getEligibleBrandNamesFromCurrentEntitlementCerts() {
    // Rules:
    // - eligible brand names come from the currently entitled productNamespaces and are identified by a brandType = "OS"
    // - the corresponding productId must be among the currently installed product certs to be eligible
    Set<String> eligibleInstalledProductIdSet = new HashSet<String>();
    Set<String> eligibleBrandNamesSet = new HashSet<String>();
    List<String> eligibleBrandNamesList = new ArrayList<String>();
    List<ProductCert> currentProductCerts = clienttasks.getCurrentProductCerts();
    for (EntitlementCert entitlementCert : clienttasks.getCurrentEntitlementCerts()) {
        for (ProductNamespace productNamespace : entitlementCert.productNamespaces) {
            if (ProductCert.findFirstInstanceWithMatchingFieldFromList("productId", productNamespace.id, currentProductCerts) != null) {
                if (productNamespace.brandType != null) {
                    if (productNamespace.brandType.equals("OS")) {
                        /* THE ORIGINAL FLEX BRANDING IMPLEMENTATION DUAL-PURPOSED THE PRODUCT NAME AS THE SOURCE OF THE BRANDING NAME
							eligibleBrandNamesList.add(productNamespace.name);
							eligibleBrandNamesSet.add(productNamespace.name);
							*/
                        eligibleBrandNamesList.add(productNamespace.brandName);
                        eligibleBrandNamesSet.add(productNamespace.brandName);
                        eligibleInstalledProductIdSet.add(productNamespace.id);
                    }
                }
            }
        }
    }
    if (eligibleBrandNamesList.size() > eligibleBrandNamesSet.size()) {
        log.warning("Currently there are multiple entitled OS brand products by the same name " + eligibleBrandNamesList + ".  This can happen when multiple OS subscriptions have been stacked.");
    }
    if (eligibleInstalledProductIdSet.size() > 1) {
        log.warning("Currently there are multiple entitled OS brand product ids installed " + eligibleInstalledProductIdSet + ".  This is likely caused by a RHEL installation or redhat-release bug.  In this case a warning is logged to " + clienttasks.rhsmLogFile + " and no update is made to the branding file '" + brandingFile + "'.");
        // 2017-10-25 13:56:44,700 [DEBUG] subscription-manager:26339:MainThread @certdirectory.py:217 - Installed product IDs: ['68', '69', '71', '76']
        // 2017-10-25 13:56:44,772 [WARNING] subscription-manager:26339:MainThread @rhelentbranding.py:114 - More than one installed product with RHEL brand information is installed
        eligibleBrandNamesSet.clear();
        // TEMPORARY WORKAROUND
        boolean invokeWorkaroundWhileBugIsOpen = true;
        // Bug 1506271 - redhat-release is providing more than 1 variant specific product cert
        String bugId = "1506271";
        try {
            if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
                log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
                SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
            } else {
                invokeWorkaroundWhileBugIsOpen = false;
            }
        } catch (BugzillaAPIException be) {
        /* ignore exception */
        } catch (RuntimeException re) {
        /* ignore exception */
        }
        if (invokeWorkaroundWhileBugIsOpen) {
            throw new SkipException("Skipping this test while bug '" + bugId + "' is open.");
        }
    // END OF WORKAROUND
    }
    return eligibleBrandNamesSet;
}
Also used : EntitlementCert(rhsm.data.EntitlementCert) ArrayList(java.util.ArrayList) ProductCert(rhsm.data.ProductCert) BugzillaAPIException(com.redhat.qe.auto.bugzilla.BugzillaAPIException) ProductNamespace(rhsm.data.ProductNamespace) SkipException(org.testng.SkipException) HashSet(java.util.HashSet)

Example 83 with BugzillaAPIException

use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.

the class CertificateTests method testIssuerOfConsumerProductAndEntitlementCerts.

@// update=true,	// uncomment to make TestDefinition changes update Polarion testcases through the polarize testcase importer
TestDefinition(projectID = { Project.RHEL6, Project.RedHatEnterpriseLinux7 }, testCaseID = { "RHEL6-20030", "RHEL7-33093" }, level = DefTypes.Level.COMPONENT, component = "subscription-manager", testtype = @TestType(testtype = DefTypes.TestTypes.FUNCTIONAL, subtype1 = DefTypes.Subtypes.RELIABILITY, subtype2 = DefTypes.Subtypes.EMPTY), posneg = PosNeg.POSITIVE, importance = DefTypes.Importance.HIGH, automation = DefTypes.Automation.AUTOMATED, tags = "Tier1")
@Test(description = "assert that the rct cat-cert tool reports the issuer of consumer/entitlement/product certificates", groups = { "Tier1Tests", "blockedByBug-968364" }, enabled = true)
public // @ImplementsNitrateTest(caseId=)
void testIssuerOfConsumerProductAndEntitlementCerts() throws JSONException, Exception {
    clienttasks.register(sm_clientUsername, sm_clientPassword, sm_clientOrg, null, null, null, null, null, null, null, (String) null, null, null, null, true, false, null, null, null, null);
    ConsumerCert consumerCert = clienttasks.getCurrentConsumerCert();
    // assert the issuer of the consumer cert
    Assert.assertNotNull(consumerCert.issuer, "The rct cat-cert tool reports the issuer of the current consumer cert: " + consumerCert);
    if (sm_serverType.equals(CandlepinType.hosted))
        Assert.assertEquals(consumerCert.issuer, "Red Hat Candlepin Authority", "Issuer of the current consumer cert: " + consumerCert.file);
    else if (sm_serverType.equals(CandlepinType.standalone))
        Assert.assertEquals(consumerCert.issuer, sm_serverHostname, "Issuer of the current consumer cert: " + consumerCert.file);
    else
        log.warning("Do not know what value to assert for issuer of the current consumer cert from a candlepin type '" + sm_serverType + "'.");
    consumerCert = null;
    // assert the issuer of a redhat product cert
    for (ProductCert productCert : clienttasks.getCurrentProductCerts()) {
        Assert.assertNotNull(productCert.issuer, "The rct cat-cert tool reports the issuer of the installed product cert: " + productCert);
        if (!productCert.file.getPath().endsWith("_.pem"))
            Assert.assertEquals(productCert.issuer, "Red Hat Entitlement Product Authority", "Issuer of the current installed product cert: " + productCert.file);
    }
    // assert the issuer of an entitlement cert
    List<EntitlementCert> entitlementCerts = clienttasks.getCurrentEntitlementCerts();
    if (entitlementCerts.isEmpty()) {
        List<SubscriptionPool> pools = clienttasks.getCurrentlyAvailableSubscriptionPools();
        if (pools.isEmpty()) {
            log.warning("Cound not find any available pool.");
            // TEMPORARY WORKAROUND
            if (clienttasks.arch.equals("ppc64le")) {
                boolean invokeWorkaroundWhileBugIsOpen = true;
                // Bug 1156638 - "Red Hat Enterprise Linux for IBM POWER" subscriptions need to provide content for arch "ppc64le"
                String bugId = "1156638";
                try {
                    if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
                        log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
                        SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
                    } else {
                        invokeWorkaroundWhileBugIsOpen = false;
                    }
                } catch (BugzillaAPIException be) {
                /* ignore exception */
                } catch (RuntimeException re) {
                /* ignore exception */
                }
                if (invokeWorkaroundWhileBugIsOpen) {
                    throw new SkipException("Skipping the remainder of this test on arch '" + clienttasks.arch + "' while blocking bug '" + bugId + "' is open.");
                }
            }
            // END OF WORKAROUND
            Assert.fail("Expected at least one available pool.  Maybe all subscriptions available to '" + sm_clientUsername + "' are being utilized.  Maybe all the available pools for this consumer's organization '" + clienttasks.getCurrentlyRegisteredOwnerKey() + "' do not support this systems arch '" + clienttasks.arch + "'.");
        }
        // randomly pick a pool
        SubscriptionPool pool = getRandomListItem(pools);
        clienttasks.subscribeToSubscriptionPool(pool);
        entitlementCerts = clienttasks.getCurrentEntitlementCerts();
    }
    for (EntitlementCert entitlementCert : entitlementCerts) {
        Assert.assertNotNull(entitlementCert.issuer, "The rct cat-cert tool reports the issuer of granted entitlement cert: " + entitlementCert);
        if (sm_serverType.equals(CandlepinType.hosted))
            Assert.assertEquals(entitlementCert.issuer, "Red Hat Candlepin Authority", "Issuer of granted entitlement cert: " + entitlementCert.file);
        else if (sm_serverType.equals(CandlepinType.standalone))
            Assert.assertEquals(entitlementCert.issuer, sm_serverHostname, "Issuer of granted entitlement cert: " + entitlementCert.file);
        else
            log.warning("Do not know what value to assert for issuer of an entitlement cert from a candlepin type '" + sm_serverType + "'.");
    }
}
Also used : EntitlementCert(rhsm.data.EntitlementCert) ProductCert(rhsm.data.ProductCert) SkipException(org.testng.SkipException) BugzillaAPIException(com.redhat.qe.auto.bugzilla.BugzillaAPIException) SubscriptionPool(rhsm.data.SubscriptionPool) ConsumerCert(rhsm.data.ConsumerCert) TestDefinition(com.github.redhatqe.polarize.metadata.TestDefinition) Test(org.testng.annotations.Test) ImplementsNitrateTest(com.redhat.qe.auto.tcms.ImplementsNitrateTest)

Example 84 with BugzillaAPIException

use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.

the class ComplianceTests method configureProductCertDirAfterClass.

@AfterClass(groups = { "setup" }, alwaysRun = true)
public void configureProductCertDirAfterClass() {
    if (clienttasks == null)
        return;
    if (this.originalProductCertDir != null) {
        clienttasks.updateConfFileParameter(clienttasks.rhsmConfFile, "productCertDir", this.originalProductCertDir);
        // TEMPORARY WORKAROUND
        boolean invokeWorkaroundWhileBugIsOpen = true;
        // Bug 1351370 - [ERROR] subscription-manager:31276 @dbus_interface.py:60 - org.freedesktop.DBus.Python.OSError: Traceback
        String bugId = "1351370";
        try {
            if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
                log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
                SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
            } else {
                invokeWorkaroundWhileBugIsOpen = false;
            }
        } catch (BugzillaAPIException be) {
        /* ignore exception */
        } catch (RuntimeException re) {
        /* ignore exception */
        }
        if (invokeWorkaroundWhileBugIsOpen) {
            // this is a workaround as shown in the ADDTIONAL INFO of Bug 1351370 TO RECOVER FROM A BAD STATE
            // Enforcing
            SSHCommandResult selinuxModeResult = client.runCommandAndWait("getenforce");
            client.runCommandAndWait("setenforce Permissive");
            clienttasks.unregister_(null, null, null, null);
            clienttasks.clean_();
            client.runCommandAndWait("setenforce " + selinuxModeResult.getStdout().trim());
        }
    // END OF WORKAROUND
    }
    allProductsSubscribableByOneCommonServiceLevelValue = null;
    allProductsSubscribableByMoreThanOneCommonServiceLevelValues.clear();
}
Also used : SSHCommandResult(com.redhat.qe.tools.SSHCommandResult) BugzillaAPIException(com.redhat.qe.auto.bugzilla.BugzillaAPIException) AfterClass(org.testng.annotations.AfterClass)

Example 85 with BugzillaAPIException

use of com.redhat.qe.auto.bugzilla.BugzillaAPIException in project rhsm-qe by RedHatQE.

the class ComplianceTests method configureProductCertDirForNoProductsSubscribable.

@BeforeGroups(groups = { "setup" }, value = "configureProductCertDirForNoProductsSubscribable")
public void configureProductCertDirForNoProductsSubscribable() {
    clienttasks.unregister(null, null, null, null);
    // TEMPORARY WORKAROUND FOR BUG: Bug 1183175 - changing to a different rhsm.productcertdir configuration throws OSError: [Errno 17] File exists
    boolean invokeWorkaroundWhileBugIsOpen = true;
    String bugId = "1183175";
    try {
        if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
            log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
            SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
        } else {
            invokeWorkaroundWhileBugIsOpen = false;
        }
    } catch (BugzillaAPIException be) {
    /* ignore exception */
    } catch (RuntimeException re) {
    /* ignore exception */
    }
    if (invokeWorkaroundWhileBugIsOpen) {
        throw new SkipException("Cannot configure a different productCertDir while bug '" + bugId + "' is open.");
    }
    // END OF WORKAROUND
    clienttasks.updateConfFileParameter(clienttasks.rhsmConfFile, "productCertDir", productCertDirForNoProductsSubscribable);
    SSHCommandResult r = client.runCommandAndWait("ls -1 " + productCertDirForNoProductsSubscribable + " | wc -l");
    if (Integer.valueOf(r.getStdout().trim()) == 0)
        throw new SkipException("Could not find any installed product certs that are non-subscribable based on the currently available subscriptions.");
    Assert.assertTrue(Integer.valueOf(r.getStdout().trim()) > 0, "The " + clienttasks.rhsmConfFile + " file is currently configured with a productCertDir that contains all non-subscribable products based on the currently available subscriptions.");
    configureProductCertDirForNoProductsSubscribableCompleted = true;
}
Also used : SSHCommandResult(com.redhat.qe.tools.SSHCommandResult) SkipException(org.testng.SkipException) BugzillaAPIException(com.redhat.qe.auto.bugzilla.BugzillaAPIException) BeforeGroups(org.testng.annotations.BeforeGroups)

Aggregations

BugzillaAPIException (com.redhat.qe.auto.bugzilla.BugzillaAPIException)134 Test (org.testng.annotations.Test)91 SkipException (org.testng.SkipException)89 TestDefinition (com.github.redhatqe.polarize.metadata.TestDefinition)88 SSHCommandResult (com.redhat.qe.tools.SSHCommandResult)77 ImplementsNitrateTest (com.redhat.qe.auto.tcms.ImplementsNitrateTest)55 ArrayList (java.util.ArrayList)44 SubscriptionPool (rhsm.data.SubscriptionPool)28 File (java.io.File)23 ProductSubscription (rhsm.data.ProductSubscription)23 ProductCert (rhsm.data.ProductCert)22 JSONObject (org.json.JSONObject)20 EntitlementCert (rhsm.data.EntitlementCert)16 InstalledProduct (rhsm.data.InstalledProduct)14 BigInteger (java.math.BigInteger)13 List (java.util.List)12 ConsumerCert (rhsm.data.ConsumerCert)11 SyndFeed (com.sun.syndication.feed.synd.SyndFeed)10 Calendar (java.util.Calendar)10 HashMap (java.util.HashMap)10