Search in sources :

Example 46 with BlockedByBzBug

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

the class ProxyTests method getEnvironmentsAttemptsUsingProxyServerDataAsListOfLists.

protected List<List<Object>> getEnvironmentsAttemptsUsingProxyServerDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (List<Object> l : getRegisterAttemptsUsingProxyServerDataAsListOfLists()) {
        // get the existing BlockedByBzBug
        BlockedByBzBug blockedByBzBug = (BlockedByBzBug) l.get(0);
        List<String> bugIds = blockedByBzBug == null ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(blockedByBzBug.getBugIds()));
        // Bug 1345962 - unbound method endheaders() must be called with HTTPSConnection instance as first argument (got RhsmProxyHTTPSConnection instance instead)
        bugIds.add("1345962");
        blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
        l.set(0, blockedByBzBug);
        // DELETEME	if (!sm_serverType.equals("katello") && (!nErrMsg.equals(l.get(9))||l.get(9)==null) && clienttasks.isPackageVersion("subscription-manager",">=","1.13.10-1")) {	// post commit 13fe8ffd8f876d27079b961fb6675424e65b9a10 bug 1119688
        if (!sm_serverType.equals("katello") && ((!nErrMsg.equals(l.get(9)) && !pErrMsg.equals(l.get(9)) && !rErrMsg.equals(l.get(9))) || l.get(9) == null) && clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.10-1")) {
            // post commit 13fe8ffd8f876d27079b961fb6675424e65b9a10 bug 1119688
            // exitCode EX_UNAVAILABLE
            l.set(7, Integer.valueOf(69));
            l.set(8, "");
            l.set(9, "Error: Server does not support environments.");
        } else // DELETEME	if (!sm_serverType.equals("katello") && !l.get(3).equals(sm_clientOrg)) {
        if (!sm_serverType.equals("katello") && (!l.get(1).equals(sm_clientUsername) || !l.get(2).equals(sm_clientPassword) || !l.get(3).equals(sm_clientOrg))) {
            // subscription-manager environments --username=testuser1 --password=password --org=bad-org
            // Stdout: This system does not support environments.
            // Stderr:
            // ExitCode: 0
            // exitCode
            l.set(7, Integer.valueOf(0));
            l.set(8, "Error: Server does not support environments.");
            l.set(9, "");
        }
        ll.add(l);
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Example 47 with BlockedByBzBug

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

the class ProxyTests method getAutoHealAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray.

@DataProvider(name = "getAutoHealAttemptsUsingProxyServerViaRhsmConfigData")
public Object[][] getAutoHealAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray() {
    // return TestNGUtils.convertListOfListsTo2dArray(getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists());
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (List<Object> l : getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists()) {
        // nullify the blockedByBug parameter since this function was originally not blocked by any bug
        BlockedByBzBug blockedByBzBug = null;
        List<String> bugIds = blockedByBzBug == null ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(blockedByBzBug.getBugIds()));
        // // add BlockedByBzBug to rows that are expecting a network error
        // if (l.get(12)==nErrMsg || l.get(12)==pErr407Msg) {
        // bugIds.add("848195");	// Bug 848195 	Error while checking server version: Proxy connection failed: 407
        // bugIds.add("848190");	// Bug 848190 	Error while checking server version: (111, 'Connection refused')
        // bugIds.add("848184");	// Bug 848184 	Error while checking server version: (-2, 'Name or service not known')
        // }
        // Bug 1345962 - unbound method endheaders() must be called with HTTPSConnection instance as first argument (got RhsmProxyHTTPSConnection instance instead)
        bugIds.add("1345962");
        blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
        ll.add(Arrays.asList(new Object[] { blockedByBzBug, l.get(1), l.get(2), l.get(3), l.get(4), l.get(5), l.get(6), l.get(7), l.get(8), l.get(9), l.get(10), l.get(11), l.get(12), l.get(13), l.get(14), l.get(15), l.get(16) }));
    }
    return TestNGUtils.convertListOfListsTo2dArray(ll);
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug) DataProvider(org.testng.annotations.DataProvider)

Example 48 with BlockedByBzBug

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

the class ProxyTests method getAutoHealAttemptsUsingProxyServerDataAs2dArray.

@DataProvider(name = "getAutoHealAttemptsUsingProxyServerData")
public Object[][] getAutoHealAttemptsUsingProxyServerDataAs2dArray() {
    // return TestNGUtils.convertListOfListsTo2dArray(getValidRegisterAttemptsUsingProxyServerDataAsListOfLists());
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (List<Object> l : getValidRegisterAttemptsUsingProxyServerDataAsListOfLists()) {
        // nullify the blockedByBug parameter since this function was originally not blocked by any bug
        BlockedByBzBug blockedByBzBug = null;
        List<String> bugIds = blockedByBzBug == null ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(blockedByBzBug.getBugIds()));
        // // add BlockedByBzBug to rows that are expecting a network error
        // if (l.get(8)==nErrMsg || l.get(8)==pErr407Msg) {
        // bugIds.add("848195");	// Bug 848195 	Error while checking server version: Proxy connection failed: 407
        // bugIds.add("848190");	// Bug 848190 	Error while checking server version: (111, 'Connection refused')
        // bugIds.add("848184");	// Bug 848184 	Error while checking server version: (-2, 'Name or service not known')
        // }
        // Bug 1345962 - unbound method endheaders() must be called with HTTPSConnection instance as first argument (got RhsmProxyHTTPSConnection instance instead)
        bugIds.add("1345962");
        blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
        ll.add(Arrays.asList(new Object[] { blockedByBzBug, l.get(1), l.get(2), l.get(3), l.get(4), l.get(5), l.get(6), l.get(7), l.get(8), l.get(9) }));
    }
    return TestNGUtils.convertListOfListsTo2dArray(ll);
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug) DataProvider(org.testng.annotations.DataProvider)

Example 49 with BlockedByBzBug

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

the class ProxyTests method getRepoOverrideAttemptsUsingProxyServerDataAs2dArray.

@DataProvider(name = "getRepoOverrideAttemptsUsingProxyServerData")
public Object[][] getRepoOverrideAttemptsUsingProxyServerDataAs2dArray() {
    // return TestNGUtils.convertListOfListsTo2dArray(getValidRegisterAttemptsUsingProxyServerDataAsListOfLists());
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (List<Object> l : getValidRegisterAttemptsUsingProxyServerDataAsListOfLists()) {
        // get the existing BlockedByBzBug
        BlockedByBzBug blockedByBzBug = (BlockedByBzBug) l.get(0);
        List<String> bugIds = blockedByBzBug == null ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(blockedByBzBug.getBugIds()));
        // add more BlockedByBzBug to rows that are....
        blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
        // nullify the blockedByBug parameter since this function was originally not blocked by any bug
        blockedByBzBug = null;
        bugIds.clear();
        // Bug 1034396 - repo-override command should not require entitlements
        bugIds.add("1034396");
        // Bug 1345962 - unbound method endheaders() must be called with HTTPSConnection instance as first argument (got RhsmProxyHTTPSConnection instance instead)
        bugIds.add("1345962");
        blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
        l.set(0, blockedByBzBug);
        if (l.get(7).equals(new Integer(0))) {
            /* valid prior to bug 1034396 
				l.set(7,new Integer(1));
				l.set(8,"This system does not have any subscriptions.");
				l.set(9,"");
				*/
            l.set(7, new Integer(0));
            l.set(8, "This system does not have any content overrides applied to it.");
            l.set(9, "");
        }
        ll.add(l);
    }
    return TestNGUtils.convertListOfListsTo2dArray(ll);
}
Also used : BigInteger(java.math.BigInteger) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug) DataProvider(org.testng.annotations.DataProvider)

Example 50 with BlockedByBzBug

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

the class ProxyTests method getRedeemAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists.

protected List<List<Object>> getRedeemAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (List<Object> l : getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists()) {
        // alter expected exitCode and stderr for rows that are normally exitCode=0 against standalone candlepin >= 2.0.7-1
        if (CandlepinType.standalone.equals(sm_serverType)) {
            if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "2.0.7-1")) {
                // candlepin commit 676ce6c2786203a33ec5eedc8dadcd664a62f09e 1263474: Standalone candlepin now returns the expected error message and code
                if (((Integer) l.get(11)).equals(Integer.valueOf(0))) {
                    // exit code
                    // get the existing BlockedByBzBug
                    BlockedByBzBug blockedByBzBug = (BlockedByBzBug) l.get(0);
                    List<String> bugIds = blockedByBzBug == null ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(blockedByBzBug.getBugIds()));
                    // add Bug 1263474 - subscription-manager redeem is not reporting the response to stdout
                    bugIds.add("1263474");
                    blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
                    ll.add(Arrays.asList(new Object[] { blockedByBzBug, l.get(1), l.get(2), l.get(3), l.get(4), l.get(5), l.get(6), l.get(7), l.get(8), l.get(9), l.get(10), new Integer(70), /*EX_SOFTWARE*/
                    l.get(12), new String("Standalone candlepin does not support redeeming a subscription."), l.get(14), l.get(15), l.get(16) }));
                    continue;
                }
            }
        }
        // only block rows where stdout != null with BlockedByBzBug("732499")
        if (l.get(12) != null) {
            // get the existing BlockedByBzBug
            BlockedByBzBug blockedByBzBug = (BlockedByBzBug) l.get(0);
            List<String> bugIds = blockedByBzBug == null ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(blockedByBzBug.getBugIds()));
            // add Bug 732499 - 'gaierror' object has no attribute 'code' / 'error' object has no attribute 'code'
            bugIds.add("732499");
            blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
            ll.add(Arrays.asList(new Object[] { blockedByBzBug, l.get(1), l.get(2), l.get(3), l.get(4), l.get(5), l.get(6), l.get(7), l.get(8), l.get(9), l.get(10), l.get(11), l.get(12), l.get(13), l.get(14), l.get(15), l.get(16) }));
        } else {
            ll.add(l);
        }
    }
    return ll;
}
Also used : BigInteger(java.math.BigInteger) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Aggregations

BlockedByBzBug (com.redhat.qe.auto.bugzilla.BlockedByBzBug)67 ArrayList (java.util.ArrayList)67 List (java.util.List)67 JSONObject (org.json.JSONObject)21 HashSet (java.util.HashSet)18 File (java.io.File)14 DataProvider (org.testng.annotations.DataProvider)14 SubscriptionPool (rhsm.data.SubscriptionPool)7 BigInteger (java.math.BigInteger)5 ProductCert (rhsm.data.ProductCert)5 HashMap (java.util.HashMap)3 JSONArray (org.json.JSONArray)3 EntitlementCert (rhsm.data.EntitlementCert)3 Repo (rhsm.data.Repo)2 BugzillaAPIException (com.redhat.qe.auto.bugzilla.BugzillaAPIException)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 SkipException (org.testng.SkipException)1 ConsumerType (rhsm.base.ConsumerType)1 YumRepo (rhsm.data.YumRepo)1