Search in sources :

Example 6 with BlockedByBzBug

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

the class StackingTests method getAvailableStackableAttributeSubscriptionPoolsDataAsListOfLists.

protected List<List<Object>> getAvailableStackableAttributeSubscriptionPoolsDataAsListOfLists() throws JSONException, Exception {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    Map<String, List<SubscriptionPool>> stackableSubscriptionPoolsMap = new HashMap<String, List<SubscriptionPool>>();
    // find all the SubscriptionPools with the same stacking_id
    for (List<Object> l : getAvailableSubscriptionPoolsDataAsListOfLists()) {
        SubscriptionPool pool = (SubscriptionPool) l.get(0);
        String stacking_id = CandlepinTasks.getPoolProductAttributeValue(sm_clientUsername, sm_clientPassword, sm_serverUrl, pool.poolId, "stacking_id");
        // skip non-stackable pools
        if (stacking_id == null)
            continue;
        // skip instance-based pools (these are covered in InstanceTests.java)
        if (CandlepinTasks.isPoolProductInstanceBased(sm_clientUsername, sm_clientPassword, sm_serverUrl, pool.poolId))
            continue;
        // add this available stackable pool to the stackableSubscriptionPoolsMap
        if (!stackableSubscriptionPoolsMap.containsKey(stacking_id))
            stackableSubscriptionPoolsMap.put(stacking_id, new ArrayList<SubscriptionPool>());
        stackableSubscriptionPoolsMap.get(stacking_id).add(pool);
    }
    // assemble the rows of data
    for (String stacking_id : stackableSubscriptionPoolsMap.keySet()) {
        List<SubscriptionPool> stackableSubscriptionPools = stackableSubscriptionPoolsMap.get(stacking_id);
        for (String attribute : new String[] { "sockets", "cores", "ram", "vcpu" }) {
            List<SubscriptionPool> stackableAttributeSubscriptionPools = new ArrayList<SubscriptionPool>();
            for (SubscriptionPool stackableSubscriptionPool : stackableSubscriptionPools) {
                if (CandlepinTasks.getPoolProductAttributeValue(sm_clientUsername, sm_clientPassword, sm_serverUrl, stackableSubscriptionPool.poolId, attribute) != null) {
                    stackableAttributeSubscriptionPools.add(stackableSubscriptionPool);
                }
            }
            if (!stackableAttributeSubscriptionPools.isEmpty()) {
                BlockedByBzBug blockedByBzBug = null;
                // Bug 871602 - [RFE] Virtual Architecture Independence  HAS EFFECTIVELY BEEN FIXED AS A DUP OF Bug 885785 - [RFE] Subscription Manager should alert a user if subscription vcpu limits are lower than system vcpu allocation
                if (attribute.equals("vcpu"))
                    blockedByBzBug = new BlockedByBzBug(new String[] { "885785", "871602" });
                // Object bugzilla, String attribute, String systemIsGuest, List<SubscriptionPool> stackableAttributeSubscriptionPools
                ll.add(Arrays.asList(new Object[] { blockedByBzBug, attribute, true, stackableAttributeSubscriptionPools }));
                ll.add(Arrays.asList(new Object[] { blockedByBzBug, attribute, false, stackableAttributeSubscriptionPools }));
            }
        }
    }
    return ll;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) JSONObject(org.json.JSONObject) SubscriptionPool(rhsm.data.SubscriptionPool) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Example 7 with BlockedByBzBug

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

the class SubscribeTests method getInstalledProductCertsDataAsListOfLists.

protected List<List<Object>> getInstalledProductCertsDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    for (ProductCert productCert : clienttasks.getCurrentProductCerts()) {
        BlockedByBzBug blockedByBzBug = null;
        // Bug 951633 - installed product with comma separated arch attribute fails to go green
        if (productCert.productNamespace.arch.contains(","))
            blockedByBzBug = new BlockedByBzBug("951633");
        ll.add(Arrays.asList(new Object[] { blockedByBzBug, productCert }));
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) JSONObject(org.json.JSONObject) ProductCert(rhsm.data.ProductCert) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Example 8 with BlockedByBzBug

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

the class SubscriptionManagerCLITestScript method getServerurlDataAsListOfLists.

protected List<List<Object>> getServerurlDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    if (servertasks == null)
        return ll;
    if (clienttasks == null)
        return ll;
    String defaultHostname = "subscription.rhn.redhat.com";
    String defaultPort = "443";
    String defaultPrefix = "/subscription";
    String serverurl;
    // initialize server_hostname server_port server_prefix with valid values from the current rhsm configurations
    String server_hostname = clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, "server", "hostname");
    String server_port = clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, "server", "port");
    String server_prefix = clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, "server", "prefix");
    // --serverurl=SERVER_URL      server url in the form of https://hostname:443/prefix
    // Object bugzilla, String serverurl, String expectedHostname, String expectedPort, String expectedPrefix, Integer expectedExitCode, String expectedStdout, String expectedStderr
    // positive tests
    serverurl = server_hostname + (server_port.isEmpty() ? "" : ":" + server_port) + server_prefix;
    ll.add(Arrays.asList(new Object[] { null, serverurl, server_hostname, server_port, server_prefix, new Integer(0), null, null }));
    serverurl = "https://" + serverurl;
    ll.add(Arrays.asList(new Object[] { null, serverurl, server_hostname, server_port, server_prefix, new Integer(0), null, null }));
    if (server_port.equals(defaultPort)) {
        serverurl = server_hostname + server_prefix;
        ll.add(Arrays.asList(new Object[] { null, serverurl, server_hostname, defaultPort, server_prefix, new Integer(0), null, null }));
        serverurl = "https://" + serverurl;
        ll.add(Arrays.asList(new Object[] { null, serverurl, server_hostname, defaultPort, server_prefix, new Integer(0), null, null }));
    }
    if (server_prefix.equals(defaultPrefix)) {
        serverurl = server_hostname + (server_port.isEmpty() ? "" : ":" + server_port);
        ll.add(Arrays.asList(new Object[] { null, serverurl, server_hostname, server_port, defaultPrefix, new Integer(0), null, null }));
        serverurl = "https://" + serverurl;
        ll.add(Arrays.asList(new Object[] { null, serverurl, server_hostname, server_port, defaultPrefix, new Integer(0), null, null }));
    }
    if (server_hostname.equals(defaultHostname)) {
        serverurl = (server_port.isEmpty() ? "" : ":" + server_port);
        ll.add(Arrays.asList(new Object[] { null, serverurl, defaultHostname, server_port, server_prefix, new Integer(0), null, null }));
        serverurl = "https://" + serverurl;
        ll.add(Arrays.asList(new Object[] { null, serverurl, defaultHostname, server_port, server_prefix, new Integer(0), null, null }));
    }
    // TODO add a case for the ipaddress of hostname
    // ignored tests
    serverurl = "";
    ll.add(Arrays.asList(new Object[] { null, serverurl, /* last set */
    ll.get(ll.size() - 1).get(2), ll.get(ll.size() - 1).get(3), ll.get(ll.size() - 1).get(4), new Integer(0), null, null }));
    // negative tests
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.17.5-1")) {
        // if (isCurrentlyConfiguredServerTypeHosted()) {
        if (isCurrentlyConfiguredServerTypeHosted() && SubscriptionManagerTasks.isVersion(servertasks.statusVersion, "<", "0.9.51.21-1")) {
            // 08-11-2015, I don't like this behavior because IT is blacklisting any prefix that does not match /subscription causing a inaccessible server to masquerade as a CA certificate error"
            // 02-17-2017, Good News - yesterday IT bumped candlepin-0.9.51.20-1 to 0.9.51.21-1 and the CA certificate error response disappeared.
            serverurl = "https://" + server_hostname + (server_port.isEmpty() ? "" : ":" + server_port) + "/PREFIX";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "842885" }), serverurl, null, null, null, new Integer(78), null, "Error: CA certificate for subscription service has not been installed." }));
            serverurl = "/";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "830767" }), serverurl, null, null, null, new Integer(78), null, "Error: CA certificate for subscription service has not been installed." }));
        } else {
            serverurl = "https://" + server_hostname + (server_port.isEmpty() ? "" : ":" + server_port) + "/PREFIX";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "842885" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at " + server_hostname + (server_port.isEmpty() ? ":" + defaultPort : ":" + server_port) + "/PREFIX" }));
            // the ending ? means that we'll accept this expected stderr message with and without the trailing slash / and was added post commit ad982c13e79917e082f336255ecc42615e1e7707 Bug 1176219 - subscription-manager repos --list with bad proxy options is silently using cache
            serverurl = "/";
            // the ending ? means that we'll accept this expected stderr message with and without the trailing slash / and was added post commit ad982c13e79917e082f336255ecc42615e1e7707 Bug 1176219 - subscription-manager repos --list with bad proxy options is silently using cache
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1320507", "830767", "1176219" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at " + server_hostname + ":" + server_port + "/?" }));
        }
        serverurl = "hostname";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1320507" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:" + server_port + server_prefix }));
        serverurl = "hostname:900";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1320507" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:900" + server_prefix }));
        serverurl = "hostname:900/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:900/prefix" }));
        serverurl = "https://" + server_hostname + ":PORT" + server_prefix;
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634", "842845" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL port should be numeric" }));
        serverurl = "https://hostname:PORT/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634", "842845" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL port should be numeric" }));
        serverurl = "https://hostname:/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL port should be numeric" }));
        serverurl = "https:/hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "https:hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "https//hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "https/hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "ftp://hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "git://hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "https://";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL is just a schema. Should include hostname, and/or port and path" }));
        serverurl = "http://";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL is just a schema. Should include hostname, and/or port and path" }));
    // TODO serverurl= "DON'T KNOW WHAT TO PUT HERE TO INVOKE THE ERROR; see exceptions.py";			ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1119688","1044686","1054496"}),						serverurl,	null,	null,	null,		new Integer(70),	"Error parsing serverurl:",	"Server URL can not be empty"}));
    // TODO serverurl= "DON'T KNOW WHAT TO PUT HERE TO INVOKE THE ERROR; see exceptions.py";			ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1119688","1044686","1054496"}),						serverurl,	null,	null,	null,		new Integer(70),	"Error parsing serverurl:",	"Server URL can not be None"}));
    } else if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.9-1")) {
        // post commit a695ef2d1da882c5f851fde90a24f957b70a63ad
        if (isCurrentlyConfiguredServerTypeHosted()) {
            // 08-11-2015, I don't like this behavior because IT is blacklisting any prefix that does not match /subscription causing a inaccessible server to masquarade as a CA certificate error"
            serverurl = "https://" + server_hostname + (server_port.isEmpty() ? "" : ":" + server_port) + "/PREFIX";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "842885" }), serverurl, null, null, null, new Integer(78), null, "Error: CA certificate for subscription service has not been installed." }));
        } else {
            serverurl = "https://" + server_hostname + (server_port.isEmpty() ? "" : ":" + server_port) + "/PREFIX";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "842885" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at " + server_hostname + (server_port.isEmpty() ? ":" + defaultPort : ":" + server_port) + "/PREFIX" }));
        }
        serverurl = "hostname";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:" + defaultPort + defaultPrefix }));
        serverurl = "hostname:900";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:900" + defaultPrefix }));
        serverurl = "hostname:900/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:900/prefix" }));
        // 08-11-2015, I don't like this new behavior because IT is blacklisting any prefix that does not match /subscription causing a inaccessible server to masquarade as a CA certificate error" because sub-man default to subscription.rhn.redhat.com when passing / as the serverurl
        // serverurl= "/";																					ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1119688","830767"}),								serverurl,	null,	null,	null,		new Integer(69),	null,						"Unable to reach the server at "+defaultHostname+":"+defaultPort+"/"}));
        serverurl = "/";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "830767" }), serverurl, null, null, null, new Integer(78), null, "Error: CA certificate for subscription service has not been installed." }));
        serverurl = "https://" + server_hostname + ":PORT" + server_prefix;
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634", "842845" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL port should be numeric" }));
        serverurl = "https://hostname:PORT/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634", "842845" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL port should be numeric" }));
        serverurl = "https://hostname:/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL port should be numeric" }));
        serverurl = "https:/hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "https:hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "https//hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "https/hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "ftp://hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "git://hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL has an invalid scheme. http:// and https:// are supported" }));
        serverurl = "https://";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL is just a schema. Should include hostname, and/or port and path" }));
        serverurl = "http://";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:", "Server URL is just a schema. Should include hostname, and/or port and path" }));
    // TODO serverurl= "DON'T KNOW WHAT TO PUT HERE TO INVOKE THE ERROR; see exceptions.py";			ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1119688","1044686","1054496"}),						serverurl,	null,	null,	null,		new Integer(70),	"Error parsing serverurl:",	"Server URL can not be empty"}));
    // TODO serverurl= "DON'T KNOW WHAT TO PUT HERE TO INVOKE THE ERROR; see exceptions.py";			ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1119688","1044686","1054496"}),						serverurl,	null,	null,	null,		new Integer(70),	"Error parsing serverurl:",	"Server URL can not be None"}));
    } else if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1")) {
        // post commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        serverurl = "https://" + server_hostname + (server_port.isEmpty() ? "" : ":" + server_port) + "/PREFIX";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "842885" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at " + server_hostname + (server_port.isEmpty() ? ":" + defaultPort : ":" + server_port) + "/PREFIX" }));
        serverurl = "hostname";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:" + defaultPort + defaultPrefix }));
        serverurl = "hostname:900";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:900" + defaultPrefix }));
        serverurl = "hostname:900/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at hostname:900/prefix" }));
        serverurl = "/";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "830767" }), serverurl, null, null, null, new Integer(69), null, "Unable to reach the server at " + defaultHostname + ":" + defaultPort + "/" }));
        serverurl = "https://" + server_hostname + ":PORT" + server_prefix;
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634", "842845" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL port should be numeric", null }));
        serverurl = "https://hostname:PORT/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634", "842845" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL port should be numeric", null }));
        serverurl = "https://hostname:/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496", "878634" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL port should be numeric", null }));
        serverurl = "https:/hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
        serverurl = "https:hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
        serverurl = "https//hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
        serverurl = "https/hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
        serverurl = "ftp://hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
        serverurl = "git://hostname/prefix";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
        serverurl = "https://";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL is just a schema. Should include hostname, and/or port and path", null }));
        serverurl = "http://";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1044686", "1054496" }), serverurl, null, null, null, new Integer(70), "Error parsing serverurl:\nServer URL is just a schema. Should include hostname, and/or port and path", null }));
    // TODO serverurl= "DON'T KNOW WHAT TO PUT HERE TO INVOKE THE ERROR; see exceptions.py";			ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1119688","1044686","1054496"}),						serverurl,	null,	null,	null,		new Integer(70),	"Error parsing serverurl:\nServer URL can not be empty",null}));
    // TODO serverurl= "DON'T KNOW WHAT TO PUT HERE TO INVOKE THE ERROR; see exceptions.py";			ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1119688","1044686","1054496"}),						serverurl,	null,	null,	null,		new Integer(70),	"Error parsing serverurl:\nServer URL can not be None",null}));
    } else {
        // serverurl= "https://"+server_hostname+":PORT"+server_prefix;									ll.add(Arrays.asList(new Object[] {	null,															serverurl,	null,	null,	null,		new Integer(255),	"Unable to reach the server at "+server_hostname+":PORT"+server_prefix,													null}));
        serverurl = "https://" + server_hostname + (server_port.isEmpty() ? "" : ":" + server_port) + "/PREFIX";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("842885"), serverurl, null, null, null, new Integer(255), "Unable to reach the server at " + server_hostname + (server_port.isEmpty() ? ":" + defaultPort : ":" + server_port) + "/PREFIX", null }));
        serverurl = "hostname";
        ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Unable to reach the server at hostname:" + defaultPort + defaultPrefix, null }));
        serverurl = "hostname:900";
        ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Unable to reach the server at hostname:900" + defaultPrefix, null }));
        serverurl = "hostname:900/prefix";
        ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Unable to reach the server at hostname:900/prefix", null }));
        serverurl = "/";
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("830767"), serverurl, null, null, null, new Integer(255), "Unable to reach the server at " + defaultHostname + ":" + defaultPort + "/", null }));
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.10.12-1")) {
            serverurl = "https://" + server_hostname + ":PORT" + server_prefix;
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496", "878634", "842845" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL port should be numeric", null }));
            serverurl = "https://hostname:PORT/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496", "878634", "842845" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL port should be numeric", null }));
            serverurl = "https://hostname:/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496", "878634" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL port should be numeric", null }));
            serverurl = "https:/hostname/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "https:hostname/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "https//hostname/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "https/hostname/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "ftp://hostname/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "git://hostname/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "https://";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL is just a schema. Should include hostname, and/or port and path", null }));
            serverurl = "http://";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1044686", "1054496" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl:\nServer URL is just a schema. Should include hostname, and/or port and path", null }));
        // TODO serverurl= "DON'T KNOW WHAT TO PUT HERE TO INVOKE THE ERROR; see exceptions.py";		ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1044686","1054496"}),						serverurl,	null,	null,	null,		new Integer(255),	"Error parsing serverurl:\nServer URL can not be empty",	null}));
        // TODO serverurl= "DON'T KNOW WHAT TO PUT HERE TO INVOKE THE ERROR; see exceptions.py";		ll.add(Arrays.asList(new Object[] {	new BlockedByBzBug(new String[]{"1044686","1054496"}),						serverurl,	null,	null,	null,		new Integer(255),	"Error parsing serverurl:\nServer URL can not be None",		null}));
        } else {
            serverurl = "https://" + server_hostname + ":PORT" + server_prefix;
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "878634", "842845" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL port should be numeric", null }));
            serverurl = "https://hostname:PORT/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "878634", "842845" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL port should be numeric", null }));
            serverurl = "https://hostname:/prefix";
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "878634" }), serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL port could not be parsed", null }));
            serverurl = "https:/hostname/prefix";
            ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "https:hostname/prefix";
            ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "https//hostname/prefix";
            ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "https/hostname/prefix";
            ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "ftp://hostname/prefix";
            ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "git://hostname/prefix";
            ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL has an invalid scheme. http:// and https:// are supported", null }));
            serverurl = "https://";
            ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL is just a schema. Should include hostname, and/or port and path", null }));
            serverurl = "http://";
            ll.add(Arrays.asList(new Object[] { null, serverurl, null, null, null, new Integer(255), "Error parsing serverurl: Server URL is just a schema. Should include hostname, and/or port and path", null }));
        }
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) JSONObject(org.json.JSONObject) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Example 9 with BlockedByBzBug

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

the class GeneralTests method getNegativeFunctionalityDataAsListOfLists.

protected List<List<Object>> getNegativeFunctionalityDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (clienttasks == null)
        return ll;
    // due to design changes, this is a decent place to dump old commands that have been removed
    // negative tests that require the system to be unregistered first...
    // Object blockedByBug, String command, Integer expectedExitCode, String expectedStdout, String expectedStderr
    clienttasks.unregister(null, null, null, null);
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1")) {
        // post commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        // python os.EX_CODES used by devel are listed here http://docs.thefoundry.co.uk/nuke/63/pythonreference/os-module.html  EX_USAGE=64  EX_DATAERR=65  EX_UNAVAILABLE=69  EX_SOFTWARE=70
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " unsubscribe --product=FOO", new Integer(2), clienttasks.command + ": error: no such option: --product", "Usage: subscription-manager unsubscribe [OPTIONS]" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " unsubscribe --regtoken=FOO", new Integer(2), clienttasks.command + ": error: no such option: --regtoken", "Usage: subscription-manager unsubscribe [OPTIONS]" }));
        if (clienttasks.isPackageVersion("subscription-manager", "<", "1.16.5-1")) {
            // commit 3d2eb4b8ef8e2094311e3872cdb9602b84fed9be     1198178: Adds pool option to remove, unsubscribe command
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " unsubscribe --pool=FOO", new Integer(2), clienttasks.command + ": error: no such option: --pool", "Usage: subscription-manager unsubscribe [OPTIONS]" }));
        } else {
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " unsubscribe --pool=FOO", new Integer(1), "", "" }));
        }
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " subscribe", new Integer(1), "", "This system is not yet registered. Try 'subscription-manager register --help' for more information." }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1162331" }), clienttasks.rhsmDebugSystemCommand(null, null, null, null, null, null, null, null, null), new Integer(1), "", "This system is not yet registered. Try 'subscription-manager register --help' for more information." }));
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.18.2-1")) {
            // post commit ad982c13e79917e082f336255ecc42615e1e7707
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1078091", "1119688", "1320507" }), clienttasks.command + " register --serverurl=https://sat6_fqdn/ --insecure", new Integer(69), "", "Unable to reach the server at sat6_fqdn:" + clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, "server", "port") }));
        } else if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.17.5-1")) {
            // subscription-manager commit ea10b99095ad58df57ed107e13bf19498e003ae8
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1078091", "1119688", "1320507" }), clienttasks.command + " register --serverurl=https://sat6_fqdn/ --insecure", new Integer(69), "", "Unable to reach the server at sat6_fqdn:" + clienttasks.getConfFileParameter(clienttasks.rhsmConfFile, "server", "port") + "/" }));
        } else {
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1078091", "1119688" }), clienttasks.command + " register --serverurl=https://sat6_fqdn/ --insecure", new Integer(69), "", "Unable to reach the server at sat6_fqdn:443/" }));
        }
        // changed by bug 874804,876305		ll.add(Arrays.asList(new Object[]{clienttasks.command+" register --servicelevel=foo",				new Integer(255),	"Error: Must use --autosubscribe with --servicelevel.", ""}));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " register --servicelevel=foo", new Integer(64), "", "Error: Must use --auto-attach with --servicelevel." }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "856236", "1119688" }), clienttasks.command + " register --activationkey=foo --org=foo --env=foo", new Integer(64), "", "Error: Activation keys do not allow environments to be specified." }));
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.16.2-1")) {
            // subscription-manager commit f14d2618ea94c18a0295ae3a5526a2ff252a3f99	and 6bd0448c85c10d8a58cae10372f0d4aa323d5c27
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1262998" }), clienttasks.command + " register --consumerid=123 --force", new Integer(64), "", "Error: Can not force registration while attempting to recover registration with consumerid. Please use --force without --consumerid to re-register or use the clean command and try again without --force." }));
        }
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " list --installed --servicelevel=foo", new Integer(64), "", "Error: --servicelevel is only applicable with --available or --consumed" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " list --no-overlap", new Integer(64), "", "Error: --no-overlap is only applicable with --available" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " list --match-installed", new Integer(64), "", "Error: --match-installed is only applicable with --available" }));
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.9-1")) {
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1162170" }), clienttasks.command + " list --pool-only", new Integer(64), "", "Error: --pool-only is only applicable with --available and/or --consumed" }));
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1162170" }), clienttasks.command + " list --pool-only --installed", new Integer(64), "", "Error: --pool-only is only applicable with --available and/or --consumed" }));
        }
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo", new Integer(2), clienttasks.command + ": error: --repo option requires an argument", "Usage: subscription-manager repo-override [OPTIONS]" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --remove", new Integer(2), clienttasks.command + ": error: --remove option requires an argument", "Usage: subscription-manager repo-override [OPTIONS]" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --add", new Integer(2), clienttasks.command + ": error: --add option requires an argument", "Usage: subscription-manager repo-override [OPTIONS]" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --add=foo", new Integer(2), clienttasks.command + ": error: --add arguments should be in the form of \"name:value\"", "Usage: subscription-manager repo-override [OPTIONS]" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --repo=foo", new Integer(64), "", "Error: The --repo option must be used with --list or --add or --remove." }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --remove=foo", new Integer(64), "", "Error: You must specify a repository to modify" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --add=foo:bar", new Integer(64), "", "Error: You must specify a repository to modify" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --list --remove-all", new Integer(64), "", "Error: You may not use --list with --remove-all" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --remove-all --add=foo:bar --repo=fb", new Integer(64), "", "Error: You may not use --add or --remove with --remove-all and --list" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --remove-all --remove=foo --repo=fb", new Integer(64), "", "Error: You may not use --add or --remove with --remove-all and --list" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --list --remove=foo --repo=fb", new Integer(64), "", "Error: You may not use --add or --remove with --remove-all and --list" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --list --remove=foo --repo=fb", new Integer(64), "", "Error: You may not use --add or --remove with --remove-all and --list" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --remove=foo --repo=foobar", new Integer(1), "", "This system is not yet registered. Try 'subscription-manager register --help' for more information." }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --add=foo:bar --repo=foobar", new Integer(1), "", "This system is not yet registered. Try 'subscription-manager register --help' for more information." }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --remove-all", new Integer(1), "", "This system is not yet registered. Try 'subscription-manager register --help' for more information." }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override --list", new Integer(1), "", "This system is not yet registered. Try 'subscription-manager register --help' for more information." }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " repo-override", new Integer(1), "", "This system is not yet registered. Try 'subscription-manager register --help' for more information." }));
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.14.3-1") && clienttasks.isPackageVersion("subscription-manager-migration", "<", "1.14.7-1")) {
            // see https://bugzilla.redhat.com/show_bug.cgi?id=1196416#c5
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1196416" }), "rhn-migrate-classic-to-rhsm --activation-key=foo", new Integer(1), "", "The --activation-key option requires that a --org be given." }));
        }
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.14.7-1")) {
            // commit 270f2a3e5f7d55b69a6f98c160d38362961b3059 Bug 1217835 - exit code from rhn-migrate-classic-to-rhsm activation-key without an org should be EX_USAGE
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1196416", "1217835" }), "rhn-migrate-classic-to-rhsm --activation-key=foo", new Integer(64), "", "The --activation-key option requires that a --org be given." }));
            // commit e6ee0dac25ac3cf6adc0d52779e6c806e7f62799		// Bug 1196396 - rhn-migrate-classic-to-rhsm should abort when using --activation-key option with --destination-user/password options
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1196396", "1217835" }), "rhn-migrate-classic-to-rhsm --activation-key=foo --destination-user=foo", new Integer(64), "", "The --activation-key option precludes the use of --destination-user and --destination-password" }));
            // commit e6ee0dac25ac3cf6adc0d52779e6c806e7f62799		// Bug 1196396 - rhn-migrate-classic-to-rhsm should abort when using --activation-key option with --destination-user/password options
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1196396", "1217835" }), "rhn-migrate-classic-to-rhsm --activation-key=foo --destination-password=bar", new Integer(64), "", "The --activation-key option precludes the use of --destination-user and --destination-password" }));
            // commit e6ee0dac25ac3cf6adc0d52779e6c806e7f62799	commit 270f2a3e5f7d55b69a6f98c160d38362961b3059
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1196396", "1217835" }), "rhn-migrate-classic-to-rhsm --activation-key=foo --environment=bar", new Integer(64), "", "The --activation-key and --environment options cannot be used together." }));
            // commit 270f2a3e5f7d55b69a6f98c160d38362961b3059 Bug 1217835 - exit code from rhn-migrate-classic-to-rhsm activation-key without an org should be EX_USAGE
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1217835" }), "rhn-migrate-classic-to-rhsm --servicelevel=foo --no-auto", new Integer(64), "", "The --servicelevel and --no-auto options cannot be used together." }));
        }
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.18.2")) {
            // 
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1390258" }), "rhn-migrate-classic-to-rhsm --remove-rhn-packages --keep", new Integer(64), "", "The --remove-rhn-packages and --keep options cannot be used together." }));
        }
        // negative tests that require the system to be registered before attempting the test...
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " register --username " + sm_clientUsername + " --password " + sm_clientPassword + (sm_clientOrg == null ? "" : " --org " + sm_clientOrg), new Integer(0), null, "" }));
        if (clienttasks.isPackageVersion("subscription-manager", "<", "1.13.13-1")) {
            // commit cb590a75f3a2de921961808d00ab251180c51691 Make 'attach' auto unless otherwise specified.
            // after bug 1159974 Error: This command requires that you specify a pool with --pool or --file, or use --auto.
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " subscribe", new Integer(64), "", "Error: This command requires that you specify a pool with --pool or use --auto.".replace("with --pool", "with --pool or --file,") }));
        }
        // message changed by commit 3167333fc3a261de939f4aa0799b4283f2b9f4d2
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " subscribe --pool=123 --auto", new Integer(64), "", "Error: --auto may not be used when specifying pools." /*"Error: Only one of --pool or --auto may be used with this command."*/
        }));
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.14.3-1")) {
            // commit bb6424e5cac93bfd3dfc9e5163d593b954359f52 1200972: Fixed grammar issue with error message in the attach command
            // was "Error: Servicelevel is unused with --pool" for a short time from subscription-manager-1.14.1-1
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1200972" }), clienttasks.command + " subscribe --pool=123 --servicelevel=foo", new Integer(64), "", "Error: The --servicelevel option cannot be used when specifying pools." }));
        } else {
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688", "1200972" }), clienttasks.command + " subscribe --pool=123 --servicelevel=foo", new Integer(64), "", "Error: Must use --auto with --servicelevel." }));
        }
        // added by bug 1275179 commit 281c1e5818eefa89bc73ba438c75494e16afc698
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1275179" }), clienttasks.command + " subscribe --quantity=2 --auto", new Integer(64), "", "Error: --quantity may not be used with an auto-attach" }));
        // added by bug 1275179 commit 281c1e5818eefa89bc73ba438c75494e16afc698
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1275179" }), clienttasks.command + " subscribe --quantity=2", new Integer(64), "", "Error: --quantity may not be used with an auto-attach" }));
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.18.2-1")) {
            // post commit 0d17fb22898be7932331bffdc8cb3526822a3bf8 Disallow empty name for --add
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo=bar --add=\"\":VALUE", new Integer(2), clienttasks.command + ": error: --add arguments should be in the form of \"name:value\"", "Usage: subscription-manager repo-override [OPTIONS]" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo=foo --add=:VALUE", new Integer(2), clienttasks.command + ": error: --add arguments should be in the form of \"name:value\"", "Usage: subscription-manager repo-override [OPTIONS]" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo=foobar --add :VALUE", new Integer(2), clienttasks.command + ": error: --add arguments should be in the form of \"name:value\"", "Usage: subscription-manager repo-override [OPTIONS]" }));
        } else {
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo=bar --add=\"\":VALUE", new Integer(1), "", "name: may not be null" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo=foo --add=:VALUE", new Integer(1), "", "name: may not be null" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo=foobar --add :VALUE", new Integer(1), "", "name: may not be null" }));
        }
        // added by bug 1275179 commit 281c1e5818eefa89bc73ba438c75494e16afc698
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1275179" }), clienttasks.command + " attach --auto --quantity=2", new Integer(64), "", "Error: --quantity may not be used with an auto-attach" }));
        // added by bug 1159974
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1119688" }), clienttasks.command + " subscribe --file=/missing/poolIds.txt", new Integer(65), "", "Error: The file \"/missing/poolIds.txt\" does not exist or cannot be read." }));
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.15.9-12")) {
            // added by bug 1246680 which trumps bug 1194906
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1246680" }), clienttasks.rhsmDebugSystemCommand(null, null, null, true, true, null, null, null, null), new Integer(0), /*"Wrote: /tmp/rhsm-debug-system-\\d+-\\d+.tar.gz"*/
            null, "" }));
        } else if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.14.1-1")) {
            // added by bug 1194906
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "1194906" }), clienttasks.rhsmDebugSystemCommand(null, null, null, true, true, null, null, null, null), new Integer(64), "", "Error: You may not use --subscriptions with --no-subscriptions." }));
        }
    } else {
        // pre commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " unsubscribe --product=FOO", new Integer(2), clienttasks.command + ": error: no such option: --product", "Usage: subscription-manager unsubscribe [OPTIONS]" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " unsubscribe --regtoken=FOO", new Integer(2), clienttasks.command + ": error: no such option: --regtoken", "Usage: subscription-manager unsubscribe [OPTIONS]" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " unsubscribe --pool=FOO", new Integer(2), clienttasks.command + ": error: no such option: --pool", "Usage: subscription-manager unsubscribe [OPTIONS]" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1078091"), clienttasks.command + " register --serverurl=https://sat6_fqdn/ --insecure", new Integer(255), "Unable to reach the server at sat6_fqdn:443/", "" }));
        // changed by bug 874804,876305		ll.add(Arrays.asList(new Object[]{clienttasks.command+" register --servicelevel=foo",				new Integer(255),	"Error: Must use --autosubscribe with --servicelevel.", ""}));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " register --servicelevel=foo", new Integer(255), "Error: Must use --auto-attach with --servicelevel.", "" }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("856236"), clienttasks.command + " register --activationkey=foo --org=foo --env=foo", new Integer(255), "Error: Activation keys do not allow environments to be specified.", "" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " list --installed --servicelevel=foo", new Integer(255), "Error: --servicelevel is only applicable with --available or --consumed", "" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " subscribe", new Integer(255), "This system is not yet registered. Try 'subscription-manager register --help' for more information.", "" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.rhsmDebugSystemCommand(null, null, null, null, null, null, null, null, null), new Integer(255), "This system is not yet registered. Try 'subscription-manager register --help' for more information.", "" }));
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.10.3-1")) {
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " list --no-overlap", new Integer(255), "Error: --no-overlap is only applicable with --available", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " list --match-installed", new Integer(255), "Error: --match-installed is only applicable with --available", "" }));
        }
        if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.10.7-1")) {
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo", new Integer(2), clienttasks.command + ": error: --repo option requires an argument", "Usage: subscription-manager repo-override [OPTIONS]" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --remove", new Integer(2), clienttasks.command + ": error: --remove option requires an argument", "Usage: subscription-manager repo-override [OPTIONS]" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --add", new Integer(2), clienttasks.command + ": error: --add option requires an argument", "Usage: subscription-manager repo-override [OPTIONS]" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --add=foo", new Integer(2), clienttasks.command + ": error: --add arguments should be in the form of \"name:value\"", "Usage: subscription-manager repo-override [OPTIONS]" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --repo=foo", new Integer(255), "Error: The --repo option must be used with --list or --add or --remove.", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --remove=foo", new Integer(255), "Error: You must specify a repository to modify", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --add=foo:bar", new Integer(255), "Error: You must specify a repository to modify", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --list --remove-all", new Integer(255), "Error: You may not use --list with --remove-all", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --remove-all --add=foo:bar --repo=fb", new Integer(255), "Error: You may not use --add or --remove with --remove-all and --list", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --remove-all --remove=foo --repo=fb", new Integer(255), "Error: You may not use --add or --remove with --remove-all and --list", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --list --remove=foo --repo=fb", new Integer(255), "Error: You may not use --add or --remove with --remove-all and --list", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --list --remove=foo --repo=fb", new Integer(255), "Error: You may not use --add or --remove with --remove-all and --list", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --remove=foo --repo=foobar", new Integer(255), "This system is not yet registered. Try 'subscription-manager register --help' for more information.", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --add=foo:bar --repo=foobar", new Integer(255), "This system is not yet registered. Try 'subscription-manager register --help' for more information.", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --remove-all", new Integer(255), "This system is not yet registered. Try 'subscription-manager register --help' for more information.", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override --list", new Integer(255), "This system is not yet registered. Try 'subscription-manager register --help' for more information.", "" }));
            ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " repo-override", new Integer(255), "This system is not yet registered. Try 'subscription-manager register --help' for more information.", "" }));
        }
        // negative tests that require the system to be registered before attempting the test...
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " register --username " + sm_clientUsername + " --password " + sm_clientPassword + (sm_clientOrg == null ? "" : " --org " + sm_clientOrg), new Integer(0), null, "" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " subscribe", new Integer(255), "Error: This command requires that you specify a pool with --pool or use --auto.", "" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " subscribe --pool=123 --auto", new Integer(255), "Error: Only one of --pool or --auto may be used with this command.", "" }));
        ll.add(Arrays.asList(new Object[] { null, clienttasks.command + " subscribe --pool=123 --servicelevel=foo", new Integer(255), "Error: Must use --auto with --servicelevel.", "" }));
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Example 10 with BlockedByBzBug

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

the class ComplianceTests method getSubscriptionPoolProvidingProductIdOnArchDataAsListOfLists.

protected List<List<Object>> getSubscriptionPoolProvidingProductIdOnArchDataAsListOfLists() throws JSONException, Exception {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    // configureProductCertDirAfterClass(); is not needed since the priority of this test is implied as 0 and run first before the other tests alter the productCertDir
    List<ProductCert> productCerts = clienttasks.getCurrentProductCerts();
    List<String> productIdArchTested = new ArrayList<String>();
    boolean isSystemVirtual = Boolean.valueOf(clienttasks.getFactValue("virt.is_guest"));
    for (List<Object> allAvailableSubscriptionPoolsDataList : getAllAvailableSubscriptionPoolsDataAsListOfLists()) {
        SubscriptionPool availableSubscriptionPool = (SubscriptionPool) allAvailableSubscriptionPoolsDataList.get(0);
        // for the purpose of this test, skip unmapped_guests_only pools when system is virtual otherwise the subscribe will fail with "Pool is restricted to unmapped virtual guests: '8a9087e34bdb9471014bdb9573e60af6'."
        if (isSystemVirtual && CandlepinTasks.isPoolRestrictedToUnmappedVirtualSystems(sm_clientUsername, sm_clientPassword, sm_serverUrl, availableSubscriptionPool.poolId))
            continue;
        // for the purpose of this test, skip physical_only pools when system is virtual otherwise the subscribe will fail with "Pool is restricted to physical systems: '8a9086d344549b0c0144549bf9ae0dd4'."
        if (isSystemVirtual && CandlepinTasks.isPoolRestrictedToPhysicalSystems(sm_clientUsername, sm_clientPassword, sm_serverUrl, availableSubscriptionPool.poolId))
            continue;
        // for the purpose of this test, skip virt_only pools when system is physical otherwise the subscribe will fail with "Pool is restricted to virtual guests: '8a9086d344549b0c0144549bf9ae0dd4'."
        if (!isSystemVirtual && CandlepinTasks.isPoolRestrictedToVirtualSystems(sm_clientUsername, sm_clientPassword, sm_serverUrl, availableSubscriptionPool.poolId))
            continue;
        List<String> providedProductIds = CandlepinTasks.getPoolProvidedProductIds(sm_clientUsername, sm_clientPassword, sm_serverUrl, availableSubscriptionPool.poolId);
        String poolProductArch = CandlepinTasks.getPoolProductAttributeValue(sm_clientUsername, sm_clientPassword, sm_serverUrl, availableSubscriptionPool.poolId, "arch");
        for (ProductCert productCert : productCerts) {
            if (providedProductIds.contains(productCert.productId)) {
                BlockedByBzBug blockedByBzBug = null;
                // if a row has already been added for this productId+arch combination, skip it since adding it would be redundant testing
                if (productIdArchTested.contains(productCert.productId + poolProductArch))
                    continue;
                // Bug 951633 - installed product with comma separated arch attribute fails to go green
                if (productCert.productNamespace.arch.contains(","))
                    blockedByBzBug = new BlockedByBzBug("951633");
                ll.add(Arrays.asList(new Object[] { blockedByBzBug, availableSubscriptionPool, productCert.productId, poolProductArch }));
                productIdArchTested.add(productCert.productId + poolProductArch);
            }
        }
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ProductCert(rhsm.data.ProductCert) SubscriptionPool(rhsm.data.SubscriptionPool) 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