Search in sources :

Example 51 with BlockedByBzBug

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

the class ProxyTests method getRefreshAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray.

@DataProvider(name = "getRefreshAttemptsUsingProxyServerViaRhsmConfigData")
public Object[][] getRefreshAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray() {
    // return TestNGUtils.convertListOfListsTo2dArray(getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists());
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (List<Object> l : getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists()) {
        // 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 expecting a network error
        if (l.get(12) == nErrMsg) {
            // Bug 975164 - subscription-manager refresh with --proxy is silently failing in rhsm.log
            bugIds.add("975164");
            // 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 52 with BlockedByBzBug

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

the class ProxyTests method getReleaseAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray.

@DataProvider(name = "getReleaseAttemptsUsingProxyServerViaRhsmConfigData")
public Object[][] getReleaseAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray() {
    // 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) {
            // Bug 848195 	Error while checking server version: Proxy connection failed: 407
            bugIds.add("848195");
            // Bug 848190 	Error while checking server version: (111, 'Connection refused')
            bugIds.add("848190");
            // Bug 848184 	Error while checking server version: (-2, 'Name or service not known')
            bugIds.add("848184");
        }
        // 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 53 with BlockedByBzBug

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

the class ProxyTests method getRepoOverrideAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray.

@DataProvider(name = "getRepoOverrideAttemptsUsingProxyServerViaRhsmConfigData")
public Object[][] getRepoOverrideAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray() {
    // return TestNGUtils.convertListOfListsTo2dArray(getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists());
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (List<Object> l : getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists()) {
        // 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(11).equals(new Integer(0))) {
            /* valid prior to bug 1034396 
				l.set(11,new Integer(1));
				l.set(12,"This system does not have any subscriptions.");
				l.set(13,"");
				*/
            l.set(11, new Integer(0));
            l.set(12, "This system does not have any content overrides applied to it.");
            l.set(13, "");
        }
        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 54 with BlockedByBzBug

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

the class ProxyTests method getReposAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray.

@DataProvider(name = "getReposAttemptsUsingProxyServerViaRhsmConfigData")
public Object[][] getReposAttemptsUsingProxyServerViaRhsmConfigDataAs2dArray() {
    // return TestNGUtils.convertListOfListsTo2dArray(getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists());
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (List<Object> l : getValidRegisterAttemptsUsingProxyServerViaRhsmConfigDataAsListOfLists()) {
        // Object blockedByBug, String username, String password, Sring org, String proxy, String proxyuser, String proxypassword, String proxy_hostnameConfig, String proxy_portConfig, String proxy_userConfig, String proxy_passwordConfig, Integer exitCode, String stdout, String stderr, SSHCommandRunner proxyRunner, String proxyLog, String proxyLogGrepPattern
        // 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 expecting a network error
        if (l.get(12) == nErrMsg) {
            // Bug 919255 - negative proxy testing against subscription-manager repos --list
            bugIds.add("919255");
        }
        if (l.get(4) == null && l.get(7) != null && l.get(7).equals("bad-proxy")) {
            // Bug 975186 - subscription-manager repos --list is failing when specifying a bad --proxy
            bugIds.add("975186");
        }
        if (l.get(4) != null && l.get(4).equals("bad-proxy") && l.get(7) != null && l.get(7).equals(sm_noauthproxyHostname)) {
            // Bug 975186 - subscription-manager repos --list is failing when specifying a bad --proxy
            bugIds.add("975186");
        }
        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 55 with BlockedByBzBug

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

the class ListTests method getListAvailableWithServicelevelDataAsListOfLists.

protected List<List<Object>> getListAvailableWithServicelevelDataAsListOfLists() throws JSONException, Exception {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    // register with force (so we can find the org to which the sm_clientUsername belongs in case sm_clientOrg is null)
    String org = sm_clientOrg;
    if (org == null) {
        String consumerId = clienttasks.getCurrentConsumerId(clienttasks.register(sm_clientUsername, sm_clientPassword, sm_clientOrg, null, null, "SubscriptionServicelevelConsumer", null, null, null, null, (String) null, null, null, null, true, false, null, null, null, null));
        org = CandlepinTasks.getOwnerKeyOfConsumerId(sm_clientUsername, sm_clientPassword, sm_serverUrl, consumerId);
    }
    // get all the valid service levels available to this org
    for (String serviceLevel : CandlepinTasks.getServiceLevelsForOrgKey(sm_clientUsername, sm_clientPassword, sm_serverUrl, org)) {
        BlockedByBzBug blockedByBug = null;
        // Bug 1011234 - subscription-manager list --avail should catch nil service-levels and report the absense of a service-level rather than "None"
        if (serviceLevel.equalsIgnoreCase("none"))
            blockedByBug = new BlockedByBzBug("1011234");
        ll.add(Arrays.asList(new Object[] { blockedByBug, serviceLevel }));
        // run again with the serviceLevel case randomized
        ll.add(Arrays.asList(new Object[] { blockedByBug, randomizeCaseOfCharactersInString(serviceLevel) }));
    }
    ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1011234"), "" }));
    ll.add(Arrays.asList(new Object[] { null, "FOO" }));
    return ll;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) JSONObject(org.json.JSONObject) 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