Search in sources :

Example 56 with BlockedByBzBug

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

the class MigrationDataTests method getRhnChannelFromProductCertsDataAsListOfLists.

public List<List<Object>> getRhnChannelFromProductCertsDataAsListOfLists() throws JSONException {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (clienttasks == null)
        return ll;
    for (String rhnChannel : cdnProductCertsChannelMap.keySet()) {
        // /*debugTesting*/ if (!rhnChannel.equals("rhel-x86_64-server-sap-7")) continue;
        // /*debugTesting*/ if (!rhnChannel.equals("rhel-x86_64-server-rs-7")) continue;
        // /*debugTesting*/ if (!rhnChannel.equals("rhel-x86_64-server-ha-7")) continue;
        File productCertFile = cdnProductCertsChannelMap.get(rhnChannel);
        String productId = getProductIdFromProductCertFilename(productCertFile.getPath());
        // filter out all RHN Channels that map to a release of rhel that does not equal the current release (clienttasks.redhatReleaseXY)
        // match it against example like: /rhel-5.9-beta/Server-Server-x86_64-4b918bda53c0-69.pem  /rhel-6.3/EUS-HighAvailability-x86_64-51676442768e-84.pem  /mrg-2.1/Server-MRG-R-x86_64-e1d154eaac1f-172.pem
        String regex = "/rhel-(\\d+)\\.(\\d+).*";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(productCertFile.getPath());
        if (matcher.find()) {
            if (!clienttasks.redhatReleaseXY.equals(matcher.group(1) + "." + matcher.group(2))) {
                log.fine("Skipping rhnChannel '" + rhnChannel + "' mapping to '" + productCertFile.getPath() + "' because it does not apply to this release of RHEL" + clienttasks.redhatReleaseXY);
                continue;
            }
        }
        // bugzillas
        Set<String> bugIds = new HashSet<String>();
        if (rhnChannel.contains("-rhev-agent-") && clienttasks.redhatReleaseX.equals("5")) /* && channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none")*/
        {
            // Bug 786278 - RHN Channels for -rhev- and -vt- in the channel-cert-mapping.txt are not mapped to a productId
            bugIds.add("786278");
        }
        if (rhnChannel.contains("-vt-")) /* && channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none")*/
        {
            // Bug 786278 - RHN Channels for -rhev- and -vt- in the channel-cert-mapping.txt are not mapped to a productId
            bugIds.add("786278");
        }
        if (rhnChannel.startsWith("rhel-i386-rhev-agent-")) /* && channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none")*/
        {
            // Bug 816364 - channel-cert-mapping.txt is missing a mapping for product 150 "Red Hat Enterprise Virtualization" on i386
            bugIds.add("816364");
        }
        if (rhnChannel.endsWith("-beta") && clienttasks.redhatReleaseX.equals("5")) /* && channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none")*/
        {
            // Bug 786203 - all RHN *beta Channels in channel-cert-mapping.txt are mapped to "none" instead of valid productId
            bugIds.add("786203");
        }
        if (rhnChannel.endsWith("-debuginfo") && clienttasks.redhatReleaseX.equals("5")) {
            // Bug 786140 - RHN Channels for "*debuginfo" are missing from the channel-cert-mapping.txt
            bugIds.add("786140");
        }
        if (rhnChannel.startsWith("rhel-x86_64-server-6-rhevh") || rhnChannel.startsWith("rhel-x86_64-server-6-rhevm-3") || rhnChannel.startsWith("rhel-x86_64-server-6-rhevm-3-jboss-5") || rhnChannel.startsWith("rhel-x86_64-server-sjis-6") || rhnChannel.startsWith("rhel-x86_64-server-sap-6") || /*
					rhnChannel.startsWith("rhel-x86_64-server-optional-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-sfs-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-ha-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-rs-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-lb-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-workstation-sfs-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-workstation-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-workstation-optional-6-htb") ||
					*/
        rhnChannel.startsWith("rhel-x86_64-rhev-mgmt-agent-6") || rhnChannel.startsWith("rhel-x86_64-server-6-cf-tools-1") || rhnChannel.startsWith("rhel-i386-server-6-cf-tools-1") || rhnChannel.startsWith("rhel-x86_64-server-6-cf-ae-1") || rhnChannel.startsWith("rhel-x86_64-server-6-cf-ce-1") || rhnChannel.startsWith("rhel-x86_64-server-6-cf-se-1") || rhnChannel.startsWith("sam-rhel-x86_64-server-6-htb") || rhnChannel.startsWith("sam-rhel-x86_64-server-6-beta")) {
            // Bug 799152 - subscription-manager-migration-data is missing some product certs for RHN Channels in product-baseline.json
            bugIds.add("799152");
        }
        if (rhnChannel.equals("rhel-s390x-server-6") || rhnChannel.equals("rhel-s390x-server-optional-6") || rhnChannel.equals("rhel-s390x-server-supplementary-6")) {
            // Bug 799103 - no mapping for s390x product cert included in the subscription-manager-migration-data
            bugIds.add("799103");
        }
        if (rhnChannel.equals("sam-rhel-x86_64-server-6") || rhnChannel.equals("sam-rhel-x86_64-server-6-debuginfo")) {
            // Bug 815433 - sam-rhel-x86_64-server-6-beta channel mapping needs replacement in channel-cert-mapping.txt
            bugIds.add("815433");
        }
        if (productId.equals("167")) {
            // Bug 811633 - channel-cert-mapping.txt is missing a mapping for product 167 "Red Hat CloudForms"
            bugIds.add("811633");
        }
        if (productId.equals("183") || productId.equals("184") || productId.equals("185"))
            if (clienttasks.redhatReleaseX.equals("6")) {
                // Bug 825603 - channel-cert-mapping.txt is missing a mapping for JBoss product ids 183,184,185
                bugIds.add("825603");
            }
        if (rhnChannel.contains("-dts-"))
            if (clienttasks.redhatReleaseX.equals("6")) {
            // Bug 820749 - channel-cert-mapping.txt is missing a mapping for product "Red Hat Developer Toolset"
            // TODO UNCOMMENT AFTER BUG 884688 IS FIXED bugIds.add("820749");
            }
        if (rhnChannel.contains("-dts-"))
            if (clienttasks.redhatReleaseX.equals("5")) {
                // Bug 852551 - channel-cert-mapping.txt is missing a mapping for product "Red Hat Developer Toolset"
                bugIds.add("852551");
            }
        if (productId.equals("195"))
            if (clienttasks.redhatReleaseX.equals("5")) {
                // Bug 869008 - mapping for productId 195 "Red Hat Developer Toolset (for RHEL for IBM POWER)" is missing
                bugIds.add("869008");
            }
        if (productId.equals("195"))
            if (clienttasks.redhatReleaseX.equals("6")) {
                // Bug 875802 - mapping for productId 195 "Red Hat Developer Toolset (for RHEL for IBM POWER)" is missing
                bugIds.add("875802");
            }
        if (productId.equals("181")) {
            // Bug 840148 - missing product cert corresponding to "Red Hat EUCJP Support (for RHEL Server)"
            bugIds.add("840148");
            // Bug 847069 - Add certificates for rhel-x86_64-server-eucjp-5* channels.
            bugIds.add("847069");
        }
        if (rhnChannel.startsWith("rhel-i386-rhev-agent-5-")) {
            // Bug 849305 - rhel-i386-rhev-agent-5-* maps in channel-cert-mapping.txt do not match CDN Product Baseline
            bugIds.add("849305");
        }
        if (rhnChannel.startsWith("jbappplatform-4.2-els-")) {
            // Bug 861470 - JBoss Enterprise Application Platform - ELS (jbappplatform-4.2.0) 192.pem product certs are missing from subscription-manager-migration-data
            bugIds.add("861470");
        }
        if (rhnChannel.startsWith("rhel-x86_64-rhev-mgmt-agent-5")) {
            // Bug 861420 - Red Hat Enterprise Virtualization (rhev-3.0) 150.pem product certs are missing from subscription-manager-migration-data
            bugIds.add("861420");
        }
        if (rhnChannel.equals("rhel-x86_64-rhev-mgmt-agent-5-debuginfo") || rhnChannel.equals("rhel-x86_64-rhev-mgmt-agent-5-beta-debuginfo")) {
            // Bug 865566 - RHEL-5/channel-cert-mapping.txt is missing a mapping for two rhev debuginfo channels
            bugIds.add("865566");
        }
        if (productId.equals("167") || productId.equals("155") || productId.equals("186") || productId.equals("191") || productId.equals("188") || productId.equals("172"))
            if (clienttasks.redhatReleaseX.equals("6")) {
                // Bug 872959 - many product certs and their RHN Channel mappings are missing from the RHEL64 subscription-manager-migration-data
                bugIds.add("872959");
            }
        if (productId.equals("197") || productId.equals("198")) {
            // Bug 875760 - some openshift product certs and their RHN Channel mappings are missing from the RHEL64 subscription-manager-migration-data
            bugIds.add("875760");
        }
        if (rhnChannel.startsWith("rhel-x86_64-server-6-ost-folsom")) {
            // Bug 884657 - the server-6-ost-folsom channels need to be mapped into channel-cert-mapping.txt
            bugIds.add("884657");
        }
        if (rhnChannel.equals("rhel-x86_64-hpc-node-dts-6") || rhnChannel.equals("rhel-x86_64-hpc-node-dts-6-debuginfo")) {
            // Bug 820749 - channel-cert-mapping.txt is missing a mapping for product "Red Hat Developer Toolset"
            bugIds.add("820749");
            // Bug 884688 - RHN channel "rhel-x86_64-hpc-node-dts-6" is mapped to 177, but the product cert 177.pem is missing
            bugIds.add("884688");
        }
        if (rhnChannel.startsWith("rhel-x86_64-server-6-rhevm-3.1")) {
            // Bug 888791 - product cert mappings for RHN Channels rhel-x86_64-server-6-rhevm-3.1* are missing
            bugIds.add("888791");
        }
        if (rhnChannel.startsWith("rhel-i386-server-sjis-6")) {
            // rhel-i386-server-sjis-6 rhel-i386-server-sjis-6-debuginfo rhel-i386-server-sjis-6-beta rhel-i386-server-sjis-6-beta-debuginfo
            // Bug 896195 - rhel-i386-server-sjis-6 channels are not yet mapped in channel-cert-mapping.txt
            bugIds.add("896195");
        }
        if (rhnChannel.startsWith("rhel-x86_64-server-7-ost-6")) {
            // rhel-x86_64-server-7-ost-6 rhel-x86_64-server-7-ost-6-debuginfo rhel-x86_64-server-7-ost-6-installer rhel-x86_64-server-7-ost-6-installer-debuginfo
            // Bug 1184653 - RHN channel to product cert mappings for OpenStack-6.0 191.pem are missing from subscription-manager-migration-data
            bugIds.add("1184653");
        }
        if (rhnChannel.startsWith("redhat-rhn-satellite-5.7-server")) {
            // redhat-rhn-satellite-5.7-server-x86_64-6 redhat-rhn-satellite-5.7-server-s390x-6
            // Bug 1184657 - RHN channel to product cert mappings for Satellite Server 5.7 250.pem are missing from subscription-manager-migration-data
            bugIds.add("1184657");
        }
        // Object bugzilla, String productBaselineRhnChannel, String productBaselineProductId
        BlockedByBzBug blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
        ll.add(Arrays.asList(new Object[] { blockedByBzBug, rhnChannel, productCertFile }));
    }
    return ll;
}
Also used : Pattern(java.util.regex.Pattern) Matcher(java.util.regex.Matcher) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) JSONObject(org.json.JSONObject) File(java.io.File) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug) HashSet(java.util.HashSet)

Example 57 with BlockedByBzBug

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

the class MigrationDataTests method getRhnRhelChannelsFromChannelMappingDataAsListOfLists.

public List<List<Object>> getRhnRhelChannelsFromChannelMappingDataAsListOfLists() throws JSONException {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (clienttasks == null)
        return ll;
    for (String rhnChannel : channelsToProductCertFilenamesMap.keySet()) {
        ProductCert rhnRhelProductCert = null;
        if (channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none"))
            rhnRhelProductCert = clienttasks.getProductCertFromProductCertFile(new File(baseProductsDir + "/" + channelsToProductCertFilenamesMap.get(rhnChannel)));
        // get all of the provided tags from the rhnRhelProductCert
        List<String> rhnRhelProductProvidedTags = new ArrayList<String>();
        if (rhnRhelProductCert != null) {
            if (rhnRhelProductCert.productNamespace.providedTags != null) {
                for (String providedTag : rhnRhelProductCert.productNamespace.providedTags.split("\\s*,\\s*")) {
                    rhnRhelProductProvidedTags.add(providedTag);
                }
            }
        }
        // consider skipping channels that do NOT provide the base release rhel-X tag
        if (!rhnRhelProductProvidedTags.contains("rhel-" + clienttasks.redhatReleaseX)) {
            // rhel-x86_64-workstation-6-debuginfo
            if (!rhnChannel.startsWith("rhel-"))
                continue;
            if (!rhnChannel.endsWith("-" + clienttasks.redhatReleaseX) && !rhnChannel.contains("-" + clienttasks.redhatReleaseX + "-"))
                continue;
            // rhel-x86_64-server-6-osop-1-rhc
            if (rhnChannel.contains("-ose-"))
                continue;
            if (rhnChannel.contains("-osop-"))
                continue;
            // rhel-x86_64-server-6-ost-3
            if (rhnChannel.contains("-ost-"))
                continue;
            // rhel-i386-server-6-mrg-messaging-2
            if (rhnChannel.contains("-mrg-messaging-"))
                continue;
            // rhel-x86_64-server-6-mrg-realtime-2
            if (rhnChannel.contains("-mrg-realtime-"))
                continue;
            // rhel-x86_64-server-6-mrg-grid-execute-2-debuginfo
            if (rhnChannel.contains("-mrg-grid-"))
                continue;
            // rhel-x86_64-server-6-mrg-management-2
            if (rhnChannel.contains("-mrg-management-"))
                continue;
            // rhel-x86_64-server-6-rhscl-1
            if (rhnChannel.contains("-rhscl-"))
                continue;
            // rhel-x86_64-rhev-mgmt-agent-6
            if (rhnChannel.contains("-rhevm-"))
                continue;
            if (rhnChannel.contains("-rhevh-") || rhnChannel.endsWith("-rhevh"))
                continue;
            if (rhnChannel.contains("-rhev-mgmt-"))
                continue;
            // rhel-x86_64-server-6-rhs-2.0
            if (rhnChannel.contains("-rhs-"))
                continue;
            // rhel-i386-server-dts2-5
            if (rhnChannel.contains("-dts-"))
                continue;
            if (rhnChannel.contains("-dts2-"))
                continue;
            // rhel-x86_64-server-hts-6
            if (rhnChannel.contains("-hts-"))
                continue;
            // rhel-x86_64-server-6-cert-beta
            if (rhnChannel.endsWith("-server-6-cert-beta"))
                continue;
            if (rhnChannel.endsWith("-server-6-cert"))
                continue;
            // rhel-x86_64-server-7-cert-beta
            if (rhnChannel.endsWith("-server-7-cert-beta"))
                continue;
            if (rhnChannel.endsWith("-server-7-cert"))
                continue;
            // rhel-x86_64-server-5-rhdirserv-8
            if (rhnChannel.contains("-rhdirserv-"))
                continue;
            // rhel-i386-server-sjis-6
            if (rhnChannel.contains("-sjis-"))
                continue;
            // rhel-x86_64-server-eucjp-6
            if (rhnChannel.contains("-eucjp-"))
                continue;
            // rhel-x86_64-server-6-cf-se-1
            if (rhnChannel.contains("-cf-ce-"))
                continue;
            if (rhnChannel.contains("-cf-me-"))
                continue;
            if (rhnChannel.contains("-cf-se-"))
                continue;
            // rhel-x86_64-server-6-ovs-supplemental
            if (rhnChannel.contains("-ovs-"))
                continue;
            // rhel-x86_64-server-hpn-6
            if (rhnChannel.contains("-hpn-"))
                continue;
            // rhel-x86_64-server-sap-6
            if (rhnChannel.contains("-sap-"))
                continue;
            // rhel-ppc64-server-bluegene-6
            if (rhnChannel.contains("-bluegene-"))
                continue;
            // rhel-ppc64-server-p7ih-6
            if (rhnChannel.contains("-p7ih-"))
                continue;
            // rhel-ppc-server-cluster-storage-5
            if (rhnChannel.contains("-cluster-storage-"))
                continue;
            // rhel-x86_64-server-6-rh-gluster-3-samba
            if (rhnChannel.contains("-rh-gluster-"))
                continue;
            // rhel-ppc-server-cluster-5
            if (rhnChannel.contains("-cluster-"))
                continue;
            // rhel-x86_64-server-5-rhcmsys-8
            if (rhnChannel.contains("-rhcmsys-"))
                continue;
        }
        // bugzillas
        Set<String> bugIds = new HashSet<String>();
        // Bug 1078527 - channel-cert-mapping for ComputeNode rhel-7 product certs are missing and wrong
        if (rhnChannel.equals("rhel-x86_64-hpc-node-fastrack-7") || rhnChannel.equals("rhel-x86_64-hpc-node-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-hpc-node-rh-common-7-debuginfo") || rhnChannel.equals("rhel-x86_64-hpc-node-7-debuginfo")) {
            bugIds.add("1078527");
        }
        // Bug 1105279 - rhn channel rhel-x86_64-server-scalefs-5 maps to a version 5.10 product cert - should be 5.1
        if (rhnChannel.equals("rhel-x86_64-server-scalefs-5") || rhnChannel.equals("rhel-x86_64-server-scalefs-5-beta")) {
            bugIds.add("1105279");
        }
        // Bug 1176260 - the RHN RHEL Channels 'rhel-<ARCH>-<VARIANT>-7-thirdparty-oracle-java-beta' map to a '7.0' version cert; should be '7.1 Beta'
        if (rhnChannel.equals("rhel-x86_64-client-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-hpc-node-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-server-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-workstation-7-thirdparty-oracle-java-beta")) {
            if (clienttasks.redhatReleaseXY.equals("7.1"))
                bugIds.add("1176260");
        }
        // Bug 1263432 - the RHN RHEL Channels 'rhel-x86_64-<VARIANT>-7-thirdparty-oracle-java-beta' map to a '7.1' version cert; should be '7.2 Beta'
        if (rhnChannel.equals("rhel-x86_64-client-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-hpc-node-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-server-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-workstation-7-thirdparty-oracle-java-beta")) {
            if (clienttasks.redhatReleaseXY.equals("7.2"))
                bugIds.add("1263432");
        }
        // Bug 1320647 - rhn channels 'rhel-ARCH-workstation-6-thirdparty-oracle-java-beta' should maps to the Beta product cert, not the GA cert.
        if (rhnChannel.equals("rhel-i386-workstation-6-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-workstation-6-thirdparty-oracle-java-beta")) {
            if (clienttasks.redhatReleaseXY.equals("6.8"))
                bugIds.add("1320647");
        }
        // Bug 1349584 - RHN RHEL Channels 'rhel-x86_64-<VARIANT>-7-thirdparty-oracle-java' map to a '7.2' version cert; should be '7.3'
        if (rhnChannel.equals("rhel-x86_64-client-7-thirdparty-oracle-java") || rhnChannel.equals("rhel-x86_64-hpc-node-7-thirdparty-oracle-java") || rhnChannel.equals("rhel-x86_64-server-7-thirdparty-oracle-java") || rhnChannel.equals("rhel-x86_64-workstation-7-thirdparty-oracle-java")) {
            if (clienttasks.redhatReleaseXY.equals("7.3"))
                bugIds.add("1349584");
        }
        // Bug 1349592 - RHN RHEL Channels 'rhel-x86_64-<VARIANT>-7-thirdparty-oracle-java-beta' map to a '7.2' version cert; should be '7.3 Beta'
        if (rhnChannel.equals("rhel-x86_64-client-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-hpc-node-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-server-7-thirdparty-oracle-java-beta") || rhnChannel.equals("rhel-x86_64-workstation-7-thirdparty-oracle-java-beta")) {
            if (clienttasks.redhatReleaseXY.equals("7.3"))
                bugIds.add("1349592");
        }
        // Bug 1464236 - RHN RHEL Channels 'rhel-x86_64-<VARIANT>-7-thirdparty-oracle-java' map to a '7.3' version cert; should be '7.4'
        if (rhnChannel.equals("rhel-x86_64-client-7-thirdparty-oracle-java") || rhnChannel.equals("rhel-x86_64-hpc-node-7-thirdparty-oracle-java") || rhnChannel.equals("rhel-x86_64-server-7-thirdparty-oracle-java") || rhnChannel.equals("rhel-x86_64-workstation-7-thirdparty-oracle-java")) {
            if (clienttasks.redhatReleaseXY.equals("7.3"))
                bugIds.add("1464236");
        }
        // Bug 1549766 - Numerous RHN RHEL Channels map to a RHEL '7.4' version certificate instead of the latest '7.5' version
        if (rhnChannel.equals("rhel-ppc64-server-extras-7") || rhnChannel.equals("rhel-ppc64-server-extras-7-debuginfo") || rhnChannel.equals("rhel-ppc64-server-fastrack-7") || rhnChannel.equals("rhel-ppc64-server-fastrack-7-debuginfo") || rhnChannel.equals("rhel-ppc64-server-optional-7") || rhnChannel.equals("rhel-ppc64-server-optional-7-debuginfo") || rhnChannel.equals("rhel-ppc64-server-optional-fastrack-7") || rhnChannel.equals("rhel-ppc64-server-optional-fastrack-7-debuginfo") || rhnChannel.equals("rhel-ppc64-server-rh-common-7") || rhnChannel.equals("rhel-ppc64-server-rh-common-7-debuginfo") || rhnChannel.equals("rhel-ppc64-server-supplementary-7") || rhnChannel.equals("rhel-ppc64-server-supplementary-7-debuginfo") || rhnChannel.equals("rhel-s390x-server-extras-7") || rhnChannel.equals("rhel-s390x-server-extras-7-debuginfo") || rhnChannel.equals("rhel-s390x-server-fastrack-7") || rhnChannel.equals("rhel-s390x-server-fastrack-7-debuginfo") || rhnChannel.equals("rhel-s390x-server-optional-7") || rhnChannel.equals("rhel-s390x-server-optional-7-debuginfo") || rhnChannel.equals("rhel-s390x-server-optional-fastrack-7") || rhnChannel.equals("rhel-s390x-server-optional-fastrack-7-debuginfo") || rhnChannel.equals("rhel-s390x-server-rh-common-7") || rhnChannel.equals("rhel-s390x-server-rh-common-7-debuginfo") || rhnChannel.equals("rhel-s390x-server-supplementary-7") || rhnChannel.equals("rhel-s390x-server-supplementary-7-debuginfo") || rhnChannel.equals("rhel-x86_64-client-extras-7") || rhnChannel.equals("rhel-x86_64-client-extras-7-debuginfo") || rhnChannel.equals("rhel-x86_64-client-fastrack-7") || rhnChannel.equals("rhel-x86_64-client-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-client-optional-7") || rhnChannel.equals("rhel-x86_64-client-optional-7-debuginfo") || rhnChannel.equals("rhel-x86_64-client-optional-fastrack-7") || rhnChannel.equals("rhel-x86_64-client-optional-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-client-rh-common-7") || rhnChannel.equals("rhel-x86_64-client-rh-common-7-debuginfo") || rhnChannel.equals("rhel-x86_64-client-supplementary-7") || rhnChannel.equals("rhel-x86_64-client-supplementary-7-debuginfo") || rhnChannel.equals("rhel-x86_64-hpc-node-extras-7") || rhnChannel.equals("rhel-x86_64-hpc-node-extras-7-debuginfo") || rhnChannel.equals("rhel-x86_64-hpc-node-fastrack-7") || rhnChannel.equals("rhel-x86_64-hpc-node-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-hpc-node-optional-7") || rhnChannel.equals("rhel-x86_64-hpc-node-optional-7-debuginfo") || rhnChannel.equals("rhel-x86_64-hpc-node-optional-fastrack-7") || rhnChannel.equals("rhel-x86_64-hpc-node-optional-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-hpc-node-rh-common-7") || rhnChannel.equals("rhel-x86_64-hpc-node-rh-common-7-debuginfo") || rhnChannel.equals("rhel-x86_64-hpc-node-supplementary-7") || rhnChannel.equals("rhel-x86_64-hpc-node-supplementary-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-extras-7") || rhnChannel.equals("rhel-x86_64-server-extras-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-fastrack-7") || rhnChannel.equals("rhel-x86_64-server-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-ha-fastrack-7") || rhnChannel.equals("rhel-x86_64-server-ha-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-optional-7") || rhnChannel.equals("rhel-x86_64-server-optional-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-optional-fastrack-7") || rhnChannel.equals("rhel-x86_64-server-optional-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-rh-common-7") || rhnChannel.equals("rhel-x86_64-server-rh-common-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-rs-fastrack-7") || rhnChannel.equals("rhel-x86_64-server-rs-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-supplementary-7") || rhnChannel.equals("rhel-x86_64-server-supplementary-7-debuginfo") || rhnChannel.equals("rhel-x86_64-server-v2vwin-7") || rhnChannel.equals("rhel-x86_64-server-v2vwin-7-debuginfo") || rhnChannel.equals("rhel-x86_64-workstation-extras-7") || rhnChannel.equals("rhel-x86_64-workstation-extras-7-debuginfo") || rhnChannel.equals("rhel-x86_64-workstation-fastrack-7") || rhnChannel.equals("rhel-x86_64-workstation-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-workstation-optional-7") || rhnChannel.equals("rhel-x86_64-workstation-optional-7-debuginfo") || rhnChannel.equals("rhel-x86_64-workstation-optional-fastrack-7") || rhnChannel.equals("rhel-x86_64-workstation-optional-fastrack-7-debuginfo") || rhnChannel.equals("rhel-x86_64-workstation-rh-common-7") || rhnChannel.equals("rhel-x86_64-workstation-rh-common-7-debuginfo") || rhnChannel.equals("rhel-x86_64-workstation-supplementary-7") || rhnChannel.equals("rhel-x86_64-workstation-supplementary-7-debuginfo") || rhnChannel.equals("")) {
            if (clienttasks.redhatReleaseXY.equals("7.5"))
                bugIds.add("1549766");
        }
        // Object bugzilla, String productBaselineRhnChannel, String productBaselineProductId
        BlockedByBzBug blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
        ll.add(Arrays.asList(new Object[] { blockedByBzBug, rhnChannel }));
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) JSONObject(org.json.JSONObject) ProductCert(rhsm.data.ProductCert) File(java.io.File) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug) HashSet(java.util.HashSet)

Example 58 with BlockedByBzBug

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

the class MigrationDataTests method getRhnChannelFromProductBaselineDataAsListOfLists.

public List<List<Object>> getRhnChannelFromProductBaselineDataAsListOfLists() throws JSONException {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (clienttasks == null)
        return ll;
    for (String productId : cdnProductBaselineProductIdMap.keySet()) {
        for (String rhnChannel : cdnProductBaselineProductIdMap.get(productId)) {
            // filter out all RHN Channels not associated with this release  (e.g., assume that an rhn channel containing "-5-" or ends in "-5" is only applicable to rhel5
            if (!(rhnChannel.contains("-" + clienttasks.redhatReleaseX + "-") || rhnChannel.endsWith("-" + clienttasks.redhatReleaseX)))
                continue;
            // skip on these RHN Channels that slip through this ^ filter
            // [root@jsefler-onprem-5server tmp]# grep jboss /tmp/product-baseline.json | grep -v Label
            // "rhel-x86_64-server-6-rhevm-3-jboss-5",
            // "rhel-x86_64-server-6-rhevm-3-jboss-5-beta",
            // "rhel-x86_64-server-6-rhevm-3-jboss-5-debuginfo",
            // "rhel-x86_64-server-6-rhevm-3-jboss-5-beta-debuginfo"
            List<String> rhnChannelExceptions = Arrays.asList("rhel-x86_64-server-6-rhevm-3-jboss-5", "rhel-x86_64-server-6-rhevm-3-jboss-5-beta", "rhel-x86_64-server-6-rhevm-3-jboss-5-debuginfo", "rhel-x86_64-server-6-rhevm-3-jboss-5-beta-debuginfo");
            if (rhnChannelExceptions.contains(rhnChannel) && !clienttasks.redhatReleaseX.equals(/*"5"*/
            "6"))
                continue;
            // bugzillas
            Set<String> bugIds = new HashSet<String>();
            if (rhnChannel.contains("-rhev-agent-") && clienttasks.redhatReleaseX.equals("5")) /* && channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none")*/
            {
                // Bug 786278 - RHN Channels for -rhev- and -vt- in the channel-cert-mapping.txt are not mapped to a productId
                bugIds.add("786278");
            }
            if (rhnChannel.contains("-vt-")) /* && channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none")*/
            {
                // Bug 786278 - RHN Channels for -rhev- and -vt- in the channel-cert-mapping.txt are not mapped to a productId
                bugIds.add("786278");
            }
            if (rhnChannel.startsWith("rhel-i386-rhev-agent-")) /* && channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none")*/
            {
                // Bug 816364 - channel-cert-mapping.txt is missing a mapping for product 150 "Red Hat Enterprise Virtualization" on i386
                bugIds.add("816364");
            }
            if (rhnChannel.endsWith("-beta") && clienttasks.redhatReleaseX.equals("5")) /* && channelsToProductCertFilenamesMap.get(rhnChannel).equalsIgnoreCase("none")*/
            {
                // Bug 786203 - all RHN *beta Channels in channel-cert-mapping.txt are mapped to "none" instead of valid productId
                bugIds.add("786203");
            }
            if (rhnChannel.endsWith("-debuginfo") && clienttasks.redhatReleaseX.equals("5")) {
                // Bug 786140 - RHN Channels for "*debuginfo" are missing from the channel-cert-mapping.txt
                bugIds.add("786140");
            }
            if (rhnChannel.startsWith("rhel-x86_64-server-6-rhevh") || rhnChannel.startsWith("rhel-x86_64-server-6-rhevm-3") || rhnChannel.startsWith("rhel-x86_64-server-6-rhevm-3-jboss-5") || rhnChannel.startsWith("rhel-x86_64-server-sjis-6") || rhnChannel.startsWith("rhel-x86_64-server-sap-6") || /*
					rhnChannel.startsWith("rhel-x86_64-server-optional-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-sfs-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-ha-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-rs-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-server-lb-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-workstation-sfs-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-workstation-6-htb") ||
					rhnChannel.startsWith("rhel-x86_64-workstation-optional-6-htb") ||
					*/
            rhnChannel.startsWith("rhel-x86_64-rhev-mgmt-agent-6") || rhnChannel.startsWith("rhel-x86_64-server-6-cf-tools-1") || rhnChannel.startsWith("rhel-i386-server-6-cf-tools-1") || rhnChannel.startsWith("rhel-x86_64-server-6-cf-ae-1") || rhnChannel.startsWith("rhel-x86_64-server-6-cf-ce-1") || rhnChannel.startsWith("rhel-x86_64-server-6-cf-se-1") || rhnChannel.startsWith("sam-rhel-x86_64-server-6-htb") || rhnChannel.startsWith("sam-rhel-x86_64-server-6-beta")) {
                // Bug 799152 - subscription-manager-migration-data is missing some product certs for RHN Channels in product-baseline.json
                bugIds.add("799152");
            }
            if (rhnChannel.equals("rhel-s390x-server-6") || rhnChannel.equals("rhel-s390x-server-optional-6") || rhnChannel.equals("rhel-s390x-server-supplementary-6")) {
                // Bug 799103 - no mapping for s390x product cert included in the subscription-manager-migration-data
                bugIds.add("799103");
            }
            if (rhnChannel.equals("sam-rhel-x86_64-server-6") || rhnChannel.equals("sam-rhel-x86_64-server-6-debuginfo")) {
                // Bug 815433 - sam-rhel-x86_64-server-6-beta channel mapping needs replacement in channel-cert-mapping.txt
                bugIds.add("815433");
            }
            if (productId.equals("167")) {
                // Bug 811633 - channel-cert-mapping.txt is missing a mapping for product 167 "Red Hat CloudForms"
                bugIds.add("811633");
            }
            if (productId.equals("183") || productId.equals("184") || productId.equals("185"))
                if (clienttasks.redhatReleaseX.equals("6")) {
                    // Bug 825603 - channel-cert-mapping.txt is missing a mapping for JBoss product ids 183,184,185
                    bugIds.add("825603");
                }
            if (rhnChannel.contains("-dts-"))
                if (clienttasks.redhatReleaseX.equals("6")) {
                    // Bug 820749 - channel-cert-mapping.txt is missing a mapping for product "Red Hat Developer Toolset"
                    bugIds.add("820749");
                }
            if (rhnChannel.contains("-dts-"))
                if (clienttasks.redhatReleaseX.equals("5")) {
                    // Bug 852551 - channel-cert-mapping.txt is missing a mapping for product "Red Hat Developer Toolset"
                    bugIds.add("852551");
                }
            if (productId.equals("195"))
                if (clienttasks.redhatReleaseX.equals("5")) {
                    // Bug 869008 - mapping for productId 195 "Red Hat Developer Toolset (for RHEL for IBM POWER)" is missing
                    bugIds.add("869008");
                }
            if (productId.equals("195"))
                if (clienttasks.redhatReleaseX.equals("6")) {
                    // Bug 875802 - mapping for productId 195 "Red Hat Developer Toolset (for RHEL for IBM POWER)" is missing
                    bugIds.add("875802");
                }
            if (productId.equals("181")) {
                // Bug 840148 - missing product cert corresponding to "Red Hat EUCJP Support (for RHEL Server)"
                bugIds.add("840148");
                // Bug 847069 - Add certificates for rhel-x86_64-server-eucjp-5* channels.
                bugIds.add("847069");
            }
            if (rhnChannel.startsWith("rhel-i386-rhev-agent-5-")) {
                // Bug 849305 - rhel-i386-rhev-agent-5-* maps in channel-cert-mapping.txt do not match CDN Product Baseline
                bugIds.add("849305");
            }
            if (rhnChannel.startsWith("jbappplatform-4.2-els-")) {
                // Bug 861470 - JBoss Enterprise Application Platform - ELS (jbappplatform-4.2.0) 192.pem product certs are missing from subscription-manager-migration-data
                bugIds.add("861470");
            }
            if (rhnChannel.startsWith("rhel-x86_64-rhev-mgmt-agent-5")) {
                // Bug 861420 - Red Hat Enterprise Virtualization (rhev-3.0) 150.pem product certs are missing from subscription-manager-migration-data
                bugIds.add("861420");
            }
            if (rhnChannel.equals("rhel-x86_64-rhev-mgmt-agent-5-debuginfo") || rhnChannel.equals("rhel-x86_64-rhev-mgmt-agent-5-beta-debuginfo")) {
                // Bug 865566 - RHEL-5/channel-cert-mapping.txt is missing a mapping for two rhev debuginfo channels
                bugIds.add("865566");
            }
            if (productId.equals("167") || productId.equals("155") || productId.equals("186") || productId.equals("191") || productId.equals("188") || productId.equals("172"))
                if (clienttasks.redhatReleaseX.equals("6")) {
                    // Bug 872959 - many product certs and their RHN Channel mappings are missing from the RHEL64 subscription-manager-migration-data
                    bugIds.add("872959");
                }
            if (productId.equals("197") || productId.equals("198")) {
                // Bug 875760 - some openshift product certs and their RHN Channel mappings are missing from the RHEL64 subscription-manager-migration-data
                bugIds.add("875760");
            }
            if (rhnChannel.startsWith("rhel-x86_64-server-6-ost-folsom")) {
                // Bug 884657 - the server-6-ost-folsom channels need to be mapped into channel-cert-mapping.txt
                bugIds.add("884657");
            }
            if (rhnChannel.equals("rhel-x86_64-hpc-node-dts-6") || rhnChannel.equals("rhel-x86_64-hpc-node-dts-6-debuginfo")) {
                // Bug 820749 - channel-cert-mapping.txt is missing a mapping for product "Red Hat Developer Toolset"
                bugIds.add("820749");
                // Bug 884688 - RHN channel "rhel-x86_64-hpc-node-dts-6" is mapped to 177, but the product cert 177.pem is missing
                bugIds.add("884688");
            }
            if (rhnChannel.startsWith("rhel-x86_64-server-6-rhevm-3.1")) {
                // Bug 888791 - product cert mappings for RHN Channels rhel-x86_64-server-6-rhevm-3.1* are missing
                bugIds.add("888791");
            }
            if (rhnChannel.startsWith("rhel-i386-server-sjis-6")) {
                // rhel-i386-server-sjis-6 rhel-i386-server-sjis-6-debuginfo rhel-i386-server-sjis-6-beta rhel-i386-server-sjis-6-beta-debuginfo
                // Bug 896195 - rhel-i386-server-sjis-6 channels are not yet mapped in channel-cert-mapping.txt
                bugIds.add("896195");
            }
            if (rhnChannel.contains("-dts-5-beta")) {
                // rhel-i386-server-dts-5-beta rhel-i386-server-dts-5-beta-debuginfo rhel-x86_64-server-dts-5-beta rhel-x86_64-server-dts-5-beta-debuginfo
                // Bug 966683 - the dts beta channels should be mapped to the RHB product cert 180
                bugIds.add("966683");
            }
            if (rhnChannel.contains("-rhev-mgmt-agent-5")) {
                // rhel-x86_64-rhev-mgmt-agent-5 rhel-x86_64-rhev-mgmt-agent-5-beta
                // Bug 966696 - Red Hat Enterprise Virtualization (rhev-3.0) 150.pem product certs are missing from subscription-manager-migration-data
                bugIds.add("966696");
            }
            // Object bugzilla, String productBaselineRhnChannel, String productBaselineProductId
            BlockedByBzBug blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
            ll.add(Arrays.asList(new Object[] { blockedByBzBug, rhnChannel, productId }));
        }
    }
    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) HashSet(java.util.HashSet)

Example 59 with BlockedByBzBug

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

the class MigrationTests method getRhnMigrateClassicToRhsmUsingProxyServerDataAsListOfLists.

protected List<List<Object>> getRhnMigrateClassicToRhsmUsingProxyServerDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    if (clienttasks == null)
        return ll;
    if (sm_rhnUsername.equals("")) {
        log.warning("RHN Username was not provided.");
        return ll;
    }
    if (sm_rhnPassword.equals("")) {
        log.warning("RHN Password was not provided.");
        return ll;
    }
    // 50;	// used to break down rhnAvailableChildChannels into smaller sub-lists to avoid bugs 818786 881952
    int rhnChildChannelSubSize = 40;
    String basicauthproxyUrl = String.format("%s:%s", sm_basicauthproxyHostname, sm_basicauthproxyPort);
    basicauthproxyUrl = basicauthproxyUrl.replaceAll(":$", "");
    String noauthproxyUrl = String.format("%s:%s", sm_noauthproxyHostname, sm_noauthproxyPort);
    noauthproxyUrl = noauthproxyUrl.replaceAll(":$", "");
    // when we are migrating away from RHN Classic to a non-hosted candlepin server, determine good credentials for rhsm registration
    // default
    String rhsmUsername = sm_clientUsername, rhsmPassword = sm_clientPassword, rhsmOrg = sm_clientOrg;
    if (clienttasks.register_(sm_rhnUsername, sm_rhnPassword, null, null, null, null, null, null, null, null, (String) null, null, null, null, true, null, null, null, null, null).getExitCode().equals(new Integer(0))) {
        // try sm_rhnUsername sm_rhnPassword...
        rhsmUsername = sm_rhnUsername;
        rhsmPassword = sm_rhnPassword;
        rhsmOrg = null;
    }
    // Note: To avoid redundant prompting for credentials, rhn-migrate-classic-to-rhsm will NOT prompt for rhsm Username/Password/Org when the rhsm server matches subscription\.rhn\.(.+\.)*redhat\.com
    // This causes a testing problem when migrating from a satellite server to rhsm hosted - adding a valid --serverurl to the options is a good workaround
    String rhsmServerUrlOption = "";
    // if (!doesStringContainMatches(sm_rhnHostname, "rhn\\.(.+\\.)*redhat\\.com")) {	// indicates that we are migrating from a non-hosted rhn server - as opposed to rhn.code.stage.redhat.com (stage) or rhn.redhat.com (production)
    if (!doesStringContainMatches(sm_rhnHostname, "(rhn|rhsm)\\.(.+\\.)*redhat\\.com")) {
        // if (doesStringContainMatches(sm_serverHostname, "subscription\\.rhn\\.(.+\\.)*redhat\\.com")) {
        if (doesStringContainMatches(sm_serverHostname, "subscription\\.(rhn|rhsm)\\.(.+\\.)*redhat\\.com")) {
            // force a valid --serverurl
            rhsmServerUrlOption = " --serverurl=" + "https://" + originalServerHostname + ":" + originalServerPort + originalServerPrefix;
        }
    } else {
        // if (doesStringContainMatches(sm_serverHostname, "subscription\\.rhn\\.(.+\\.)*redhat\\.com")) {
        if (doesStringContainMatches(sm_serverHostname, "subscription\\.(rhn|rhsm)\\.(.+\\.)*redhat\\.com")) {
            // so don't pass them to the rhn-migrate-classic-to-rhsm.tcl script or else you won't get the expected rhn-migrate-classic-to-rhsm exit code because the tcl script will be prematurely exited without getting the actual exit code from rhn-migrate-classic-to-rhsm.
            if (sm_rhnUsername.equals(rhsmUsername)) {
                rhsmUsername = null;
                rhsmPassword = null;
                rhsmOrg = null;
            }
        }
    }
    // Object bugzilla, String rhnUsername, String rhnPassword, String rhnServer, List<String> rhnChannelsToAdd, String options, String rhsmUsername, String rhsmPassword, String rhsmOrg, String proxy_hostnameConfig, String proxy_portConfig, String proxy_userConfig, String proxy_passwordConfig, Integer exitCode, String stdout, String stderr, SSHCommandRunner proxyRunner, String proxyLog, String proxyLogRegex
    // basic auth proxy test data...
    ll.add(Arrays.asList(new Object[] { null, sm_rhnUsername, sm_rhnPassword, sm_rhnHostname, new ArrayList<String>(), "--no-auto" + rhsmServerUrlOption, sm_rhnUsername, sm_rhnPassword, rhsmUsername, rhsmPassword, rhsmOrg, sm_basicauthproxyHostname, sm_basicauthproxyPort, sm_basicauthproxyUsername, sm_basicauthproxyPassword, Integer.valueOf(0), null, null, basicAuthProxyRunner, sm_basicauthproxyLog, "TCP_MISS" }));
    ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("915847"), sm_rhnUsername, sm_rhnPassword, sm_rhnHostname, new ArrayList<String>(), "--no-auto --no-proxy" + rhsmServerUrlOption, sm_rhnUsername, sm_rhnPassword, rhsmUsername, rhsmPassword, rhsmOrg, sm_basicauthproxyHostname, sm_basicauthproxyPort, sm_basicauthproxyUsername, sm_basicauthproxyPassword, Integer.valueOf(0), null, null, basicAuthProxyRunner, sm_basicauthproxyLog, "TCP_MISS" }));
    ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("798015"), sm_rhnUsername, sm_rhnPassword, sm_rhnHostname, new ArrayList<String>(), "--no-auto" + rhsmServerUrlOption, sm_rhnUsername, sm_rhnPassword, rhsmUsername, rhsmPassword, rhsmOrg, "http://" + sm_basicauthproxyHostname, sm_basicauthproxyPort, sm_basicauthproxyUsername, sm_basicauthproxyPassword, Integer.valueOf(0), null, null, basicAuthProxyRunner, sm_basicauthproxyLog, "TCP_MISS" }));
    // ll.add(Arrays.asList(new Object[]{new BlockedByBzBug("818786"),	sm_rhnUsername,	sm_rhnPassword,	sm_rhnHostname,	rhnAvailableChildChannels,		"--no-auto --force"+rhsmServerUrlOption,	sm_rhnUsername,	sm_rhnPassword,	rhsmUsername,	rhsmPassword,	rhsmOrg,	sm_basicauthproxyHostname,	sm_basicauthproxyPort,		sm_basicauthproxyUsername,	sm_basicauthproxyPassword,	Integer.valueOf(0),		null,		null,		basicAuthProxyRunner,	sm_basicauthproxyLog,	"TCP_MISS"}));
    /* 6/5/2014 although valid, all these rows take too long, replacing with a single row and a random subset of rhnAvailableChildChannels
		for (int i=0; i<rhnAvailableChildChannels.size(); i+=rhnChildChannelSubSize) {	// split rhnAvailableChildChannels into sub-lists of 50 channels to avoid bug 818786 - 502 Proxy Error traceback during large rhn-migrate-classic-to-rhsm
			ll.add(Arrays.asList(new Object[]{new BlockedByBzBug("980209"),	sm_rhnUsername,	sm_rhnPassword,	sm_rhnHostname,	rhnAvailableChildChannels.subList(i, Math.min(i+rhnChildChannelSubSize,rhnAvailableChildChannels.size())),	"--no-auto --force"+rhsmServerUrlOption,	sm_rhnUsername,	sm_rhnPassword,	rhsmUsername,	rhsmPassword,	rhsmOrg,	sm_basicauthproxyHostname,	sm_basicauthproxyPort,		sm_basicauthproxyUsername,	sm_basicauthproxyPassword,	Integer.valueOf(0),		null,		null,		basicAuthProxyRunner,	sm_basicauthproxyLog,	"TCP_MISS"}));
		}
		*/
    ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("980209"), sm_rhnUsername, sm_rhnPassword, sm_rhnHostname, getRandomSubsetOfList(rhnAvailableChildChannels, rhnChildChannelSubSize), "--no-auto --force" + rhsmServerUrlOption, sm_rhnUsername, sm_rhnPassword, rhsmUsername, rhsmPassword, rhsmOrg, sm_basicauthproxyHostname, sm_basicauthproxyPort, sm_basicauthproxyUsername, sm_basicauthproxyPassword, Integer.valueOf(0), null, null, basicAuthProxyRunner, sm_basicauthproxyLog, "TCP_MISS" }));
    // no auth proxy test data...
    ll.add(Arrays.asList(new Object[] { null, sm_rhnUsername, sm_rhnPassword, sm_rhnHostname, new ArrayList<String>(), "--no-auto" + rhsmServerUrlOption, sm_rhnUsername, sm_rhnPassword, rhsmUsername, rhsmPassword, rhsmOrg, sm_noauthproxyHostname, sm_noauthproxyPort, "", "", Integer.valueOf(0), null, null, noAuthProxyRunner, sm_noauthproxyLog, "Connect" }));
    ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("915847"), sm_rhnUsername, sm_rhnPassword, sm_rhnHostname, new ArrayList<String>(), "--no-auto --no-proxy" + rhsmServerUrlOption, sm_rhnUsername, sm_rhnPassword, rhsmUsername, rhsmPassword, rhsmOrg, sm_noauthproxyHostname, sm_noauthproxyPort, "", "", Integer.valueOf(0), null, null, noAuthProxyRunner, sm_noauthproxyLog, "Connect" }));
    ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("798015"), sm_rhnUsername, sm_rhnPassword, sm_rhnHostname, new ArrayList<String>(), "--no-auto" + rhsmServerUrlOption, sm_rhnUsername, sm_rhnPassword, rhsmUsername, rhsmPassword, rhsmOrg, "http://" + sm_noauthproxyHostname, sm_noauthproxyPort, "", "", Integer.valueOf(0), null, null, noAuthProxyRunner, sm_noauthproxyLog, "Connect" }));
    // ll.add(Arrays.asList(new Object[]{new BlockedByBzBug("818786"),	sm_rhnUsername,	sm_rhnPassword,	sm_rhnHostname,	rhnAvailableChildChannels,		"--no-auto --force"+rhsmServerUrlOption,	sm_rhnUsername,	sm_rhnPassword,	rhsmUsername,	rhsmPassword,	rhsmOrg,	sm_noauthproxyHostname,	sm_noauthproxyPort,		"",							"",						Integer.valueOf(0),		null,		null,		noAuthProxyRunner,	sm_noauthproxyLog,		"Connect"}));
    /* 6/5/2014 although valid, all these rows take too long, replacing with a single row and a random subset of rhnAvailableChildChannels
		for (int i=0; i<rhnAvailableChildChannels.size(); i+=rhnChildChannelSubSize) {	// split rhnAvailableChildChannels into sub-lists of 50 channels to avoid bug 818786 - 502 Proxy Error traceback during large rhn-migrate-classic-to-rhsm
			ll.add(Arrays.asList(new Object[]{new BlockedByBzBug("980209"),	sm_rhnUsername,	sm_rhnPassword,	sm_rhnHostname,	rhnAvailableChildChannels.subList(i, Math.min(i+rhnChildChannelSubSize,rhnAvailableChildChannels.size())),	"--no-auto --force"+rhsmServerUrlOption,	sm_rhnUsername,	sm_rhnPassword,	rhsmUsername,	rhsmPassword,	rhsmOrg,	sm_noauthproxyHostname,	sm_noauthproxyPort,		"",							"",						Integer.valueOf(0),		null,		null,		noAuthProxyRunner,	sm_noauthproxyLog,		"Connect"}));
		}
		*/
    ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("980209"), sm_rhnUsername, sm_rhnPassword, sm_rhnHostname, getRandomSubsetOfList(rhnAvailableChildChannels, rhnChildChannelSubSize), "--no-auto --force" + rhsmServerUrlOption, sm_rhnUsername, sm_rhnPassword, rhsmUsername, rhsmPassword, rhsmOrg, sm_noauthproxyHostname, sm_noauthproxyPort, "", "", Integer.valueOf(0), null, null, noAuthProxyRunner, sm_noauthproxyLog, "Connect" }));
    // when testing with child channels, add bug BlockedByBzBug 1075167 to affected rows
    for (List<Object> l : ll) {
        if (!((List<String>) (l.get(4))).isEmpty()) {
            // affected rows have a positive List<String> rhnChannelsToAdd
            // 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 1075167 - rhn-migrate-classic-to-rhsm throws Traceback KeyError: "Unknown feature: 'IDENTITY'"
            bugIds.add("1075167");
            blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
            l.set(0, blockedByBzBug);
        }
    }
    // if (clienttasks.redhatReleaseX.equals("7") && clienttasks.variant.equals("ComputeNode")) {
    if ("rhel-x86_64-hpc-node-7".equals(rhnBaseChannel)) {
        for (List<Object> l : ll) {
            if (((List<String>) (l.get(4))).isEmpty()) {
                // affected rows have an empty List<String> rhnChannelsToAdd
                // 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 1078527 - channel-cert-mapping for ComputeNode rhel-7 product certs are missing and wrong
                bugIds.add("1078527");
                blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
                l.set(0, blockedByBzBug);
            }
        }
    }
    // when testing with --serverurl specified, add bug BlockedByBzBug 1131213 to affected rows
    for (List<Object> l : ll) {
        if (((String) (l.get(5))).contains("--serverurl")) {
            // affected rows contain --serverurl in the String options parameter
            // 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 1131213 - rhn-migrate-classic-to-rhsm throws gaierror: [Errno -2] Name or service not known
            bugIds.add("1131213");
            // Bug 1171808 - rhn-migrate-classic-to-rhsm throws gaierror: [Errno -2] Name or service not known
            bugIds.add("1171808");
            blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
            l.set(0, blockedByBzBug);
        }
    }
    // when testing with --serverurl/--destination-url specified, add bug BlockedByBzBug 1157761 to affected rows
    if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.13.1")) {
        for (List<Object> l : ll) {
            if (((String) (l.get(5))).contains("--serverurl")) {
                // affected rows contain --serverurl in the String options parameter
                // 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 1157761 - broken --destination-url option in rhn-migrate-rhn-classic-to-rhsm
                bugIds.add("1157761");
                blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
                l.set(0, blockedByBzBug);
            }
        }
    }
    /* this update is also retrofitted in executeRhnMigrateClassicToRhsm */
    if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.13.1")) {
        for (List<Object> l : ll) {
            String options = (String) (l.get(5));
            if (options != null) {
                options = options.replace("--serverurl", "--destination-url");
                options = options.replace("--redhat-user", "--legacy-user");
                options = options.replace("--redhat-password", "--legacy-password");
                options = options.replace("--subscription-service-user", "--destination-user");
                options = options.replace("--subscription-service-password", "--destination-password");
                options = options.replace("--servicelevel", "--service-level");
                if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.13.8-1")) {
                    // 1157761: revert to "--servicelevel"
                    if (options != null)
                        options = options.replace("--service-level", "--servicelevel");
                }
            }
            l.set(5, options);
        }
    }
    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)

Example 60 with BlockedByBzBug

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

the class OrgsTests method getInteractiveCredentialsForOrgsDataAsListOfLists.

protected List<List<Object>> getInteractiveCredentialsForOrgsDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    if (servertasks == null)
        return ll;
    if (clienttasks == null)
        return ll;
    String uErrMsg = servertasks.invalidCredentialsRegexMsg();
    String x = String.valueOf(getRandInt());
    if (clienttasks.isPackageInstalled("expect")) {
        // Object bugzilla, String promptedUsername, String promptedPassword, String commandLineUsername, String commandLinePassword, Integer expectedExitCode, String expectedStdoutRegex, String expectedStderrRegex
        ll.add(Arrays.asList(new Object[] { null, sm_clientUsername, null, null, sm_clientPassword, new Integer(0), sm_clientUsername + " Organizations", null }));
        ll.add(Arrays.asList(new Object[] { null, sm_clientUsername + x, null, null, sm_clientPassword, new Integer(255), uErrMsg, null }));
        ll.add(Arrays.asList(new Object[] { null, null, sm_clientPassword, sm_clientUsername, null, new Integer(0), sm_clientUsername + " Organizations", null }));
        ll.add(Arrays.asList(new Object[] { null, null, sm_clientPassword + x, sm_clientUsername, null, new Integer(255), uErrMsg, null }));
        ll.add(Arrays.asList(new Object[] { null, sm_clientUsername, sm_clientPassword, null, null, new Integer(0), sm_clientUsername + " Organizations", null }));
        ll.add(Arrays.asList(new Object[] { null, sm_clientUsername + x, sm_clientPassword + x, null, null, new Integer(255), uErrMsg, null }));
        ll.add(Arrays.asList(new Object[] { null, "\n\n" + sm_clientUsername, "\n\n" + sm_clientPassword, null, null, new Integer(0), "(\nUsername: ){3}" + sm_clientUsername + "(\nPassword: ){3}" + "\\n\\+-+\\+\\n" + " *" + sm_clientUsername + " Organizations", null }));
    } else {
        // Object bugzilla, String promptedUsername, String promptedPassword, String commandLineUsername, String commandLinePassword, Integer expectedExitCode, String expectedStdoutRegex, String expectedStderrRegex
        ll.add(Arrays.asList(new Object[] { null, sm_clientUsername, null, null, sm_clientPassword, new Integer(0), sm_clientUsername + " Organizations", null }));
        ll.add(Arrays.asList(new Object[] { null, sm_clientUsername + x, null, null, sm_clientPassword, new Integer(255), null, uErrMsg }));
        ll.add(Arrays.asList(new Object[] { null, null, sm_clientPassword, sm_clientUsername, null, new Integer(0), sm_clientUsername + " Organizations", null }));
        ll.add(Arrays.asList(new Object[] { null, null, sm_clientPassword + x, sm_clientUsername, null, new Integer(255), null, uErrMsg }));
        ll.add(Arrays.asList(new Object[] { null, sm_clientUsername, sm_clientPassword, null, null, new Integer(0), sm_clientUsername + " Organizations", null }));
        ll.add(Arrays.asList(new Object[] { null, sm_clientUsername + x, sm_clientPassword + x, null, null, new Integer(255), null, uErrMsg }));
        ll.add(Arrays.asList(new Object[] { null, "\n\n" + sm_clientUsername, "\n\n" + sm_clientPassword, null, null, new Integer(0), "(Username: ){3}.*\\n.*" + sm_clientUsername + " Organizations", "(Warning: Password input may be echoed.\nPassword: \n){3}" }));
    }
    // for all rows with expectedExitCode=255, change the expected exitCode when testing post subscription-manager-1.13.8-1
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1")) {
        // post commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        for (List<Object> l : ll) {
            // Object bugzilla, String promptedUsername, String promptedPassword, String commandLineUsername, String commandLinePassword, Integer expectedExitCode, String expectedStdoutRegex, String expectedStderrRegex
            if (((Integer) l.get(5)).equals(255)) {
                // 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 1119688 - [RFE] subscription-manager better usability for scripts
                bugIds.add("1119688");
                blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
                l.set(0, blockedByBzBug);
                // EX_SOFTWARE
                l.set(5, new Integer(70));
            }
        }
    }
    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