Search in sources :

Example 31 with BlockedByBzBug

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

the class RedeemTests method getOnPremisesMockAttemptToRedeemDataAsListOfLists.

protected List<List<Object>> getOnPremisesMockAttemptToRedeemDataAsListOfLists() throws Exception {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    // register
    clienttasks.register(sm_clientUsername, sm_clientPassword, sm_clientOrg, null, null, null, null, null, null, null, (String) null, null, null, null, true, false, null, null, null, null);
    // String testDescription, String serialNumber, Integer expectedExitCode, String expectedStdout, String expectedStderr
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.9-1")) {
        // post commit a695ef2d1da882c5f851fde90a24f957b70a63ad
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1119688"), "This mocked redeem test attempts to redeem a subscription against a standalone candlepin server.", "0ABCDEF", new Integer(70), /*EX_SOFTWARE*/
        null, "Standalone candlepin does not support redeeming a subscription for dmi.system.serial_number: {0}" }));
    } else if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1")) {
        // post commit df95529a5edd0be456b3528b74344be283c4d258 bug 1119688
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1119688"), "This mocked redeem test attempts to redeem a subscription against a standalone candlepin server.", "0ABCDEF", new Integer(70), /*EX_SOFTWARE*/
        "Standalone candlepin does not support redeeming a subscription for dmi.system.serial_number: {0}", null }));
    } else {
        ll.add(Arrays.asList(new Object[] { null, "This mocked redeem test attempts to redeem a subscription against a standalone candlepin server.", "0ABCDEF", new Integer(255), "Standalone candlepin does not support redeeming a subscription for dmi.system.serial_number: {0}", null }));
    }
    ll.add(Arrays.asList(new Object[] { null, "This mocked redeem test attempts to redeem a subscription when the system's asset tag has already been used to redeem a subscription.", "1ABCDEF", new Integer(0), null, "The Dell service tag: {0}, has already been used to activate a subscription" }));
    ll.add(Arrays.asList(new Object[] { null, "This mocked redeem test attempts to redeem a subscription for which the system's asset tag will not be found for redemption.", "2ABCDEF", new Integer(0), null, "A subscription was not found for the given Dell service tag: {0}" }));
    ll.add(Arrays.asList(new Object[] { null, "This mocked redeem test attempts to redeem a subscription for which the system's  service tag is expired.", "3ABCDEF", new Integer(0), null, "The Dell service tag: {0}, is expired" }));
    ll.add(Arrays.asList(new Object[] { null, "This mocked redeem test attempts to redeem a subscription at a time when the system is unable to process the request.", "4ABCDEF", new Integer(0), null, "The system is unable to process the requested subscription activation {0}" }));
    ll.add(Arrays.asList(new Object[] { null, "This mocked redeem test attempts to redeem a subscription from a system with a valid asset tag.", "5ABCDEF", new Integer(0), null, "Your subscription activation is being processed and should be available soon. You will be notified via email once it is available. If you have any questions, additional information can be found here: https://access.redhat.com/kb/docs/DOC-53864." }));
    ll.add(Arrays.asList(new Object[] { null, "This mocked redeem test attempts to redeem a subscription at a time when the system is unable to process the request.", "6ABCDEF", new Integer(0), null, "The system is unable to process the requested subscription activation {0}" }));
    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 32 with BlockedByBzBug

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

the class RegisterTests method getRegisterWithNameAndTypeDataAsListOfLists.

protected List<List<Object>> getRegisterWithNameAndTypeDataAsListOfLists() throws JSONException, Exception {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    String username = sm_clientUsername;
    String password = sm_clientPassword;
    String owner = sm_clientOrg;
    List<String> registerableConsumerTypes = new ArrayList<String>();
    JSONArray jsonConsumerTypes = new JSONArray(CandlepinTasks.getResourceUsingRESTfulAPI(sm_serverAdminUsername, sm_serverAdminPassword, sm_serverUrl, "/consumertypes"));
    for (int i = 0; i < jsonConsumerTypes.length(); i++) {
        JSONObject jsonConsumerType = (JSONObject) jsonConsumerTypes.get(i);
        String consumerType = jsonConsumerType.getString("label");
        registerableConsumerTypes.add(consumerType);
    }
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.20.2-1")) {
        // Allowing a RHUI type to register is now acceptable, but not advertised
        if (!registerableConsumerTypes.contains(ConsumerType.RHUI.toString()))
            registerableConsumerTypes.add(ConsumerType.RHUI.toString());
    }
    // iterate across all ConsumerType values and append rows to the dataProvider
    for (ConsumerType type : ConsumerType.values()) {
        String name = type.toString() + "_NAME";
        // decide what username and password to test with
        if (type.equals(ConsumerType.person) && !getProperty("sm.rhpersonal.username", "").equals("")) {
            username = sm_rhpersonalUsername;
            password = sm_rhpersonalPassword;
            owner = sm_rhpersonalOrg;
        } else {
            username = sm_clientUsername;
            password = sm_clientPassword;
            owner = sm_clientOrg;
        }
        // String username, String password, String owner, String name, ConsumerType type, Integer expectedExitCode, String expectedStdoutRegex, String expectedStderrRegex
        if (registerableConsumerTypes.contains(type.toString())) {
            /* applicable to RHEL61 and RHEL57
				if (type.equals(ConsumerType.person)) {
					ll.add(Arrays.asList(new Object[] {new BlockedByBzBug("661130"),	username,	password,	name,	type,	Integer.valueOf(0),	"[a-f,0-9,\\-]{36} "+username,	null}));
				} else {
					ll.add(Arrays.asList(new Object[]{null,  							username,	password,	name,	type,	Integer.valueOf(0),	"[a-f,0-9,\\-]{36} "+name,	null}));			
				}
				*/
            Integer expectedExitCode = new Integer(0);
            String expectedStdoutRegex = "The system has been registered with ID: [a-f,0-9,\\-]{36}";
            String expectedStderrRegex = null;
            if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", /*TODO CHANGE TO ">" after candlepin 2.1.2-1 is tagged*/
            "2.1.1-1")) {
                // candlepin commit 739b51a0d196d9d3153320961af693a24c0b826f Bug 1455361: Disallow candlepin consumers to be registered via Subscription Manager
                if (ConsumerType.candlepin.equals(type) | ConsumerType.headpin.equals(type) | ConsumerType.katello.equals(type)) {
                    // FINE: ssh root@jsefler-rhel7.usersys.redhat.com subscription-manager register --username=testuser1 --password=password --org=admin --type=candlepin --name="candlepin_NAME"
                    // FINE: Stdout: Registering to: jsefler-candlepin.usersys.redhat.com:8443/candlepin
                    // FINE: Stderr: You may not create a manifest consumer via Subscription Manager.
                    // FINE: ExitCode: 70
                    expectedStdoutRegex = null;
                    expectedStderrRegex = "You may not create a manifest consumer via Subscription Manager.";
                    expectedExitCode = Integer.valueOf(70);
                }
            }
            if (SubscriptionManagerTasks.isVersion(servertasks.statusVersion, ">=", "2.1.1-1")) {
                // candlepin commit 6976b7c45d48945d6d0bf1118bd1d8edebceb1f0
                if (ConsumerType.share.equals(type)) {
                    // FINE: ssh root@jsefler-rhel7.usersys.redhat.com subscription-manager register --username=testuser1 --password=password --org=admin --type=share --name="share_NAME"
                    // FINE: Stdout: Registering to: jsefler-candlepin.usersys.redhat.com:8443/candlepin
                    // FINE: Stderr: A unit type of "share" cannot have installed products
                    // FINE: ExitCode: 70
                    expectedStdoutRegex = null;
                    // Note: assuming there is at least one installed product since our client is a RHEL product afterall
                    expectedStderrRegex = "A unit type of \"share\" cannot have installed products";
                    expectedExitCode = Integer.valueOf(70);
                }
            }
            ll.add(Arrays.asList(new Object[] { null, username, password, owner, name, type, expectedExitCode, expectedStdoutRegex, expectedStderrRegex }));
        } else {
            String expectedStderrRegex = "No such consumer type: " + type;
            if (!clienttasks.workaroundForBug876764(sm_serverType))
                expectedStderrRegex = "No such unit type: " + type;
            // changed to this by bug 876758 comment 5; https://bugzilla.redhat.com/show_bug.cgi?id=876758#c5
            expectedStderrRegex = String.format("Unit type '%s' could not be found.", type);
            Integer expectedExitCode = new Integer(255);
            // EX_SOFTWARE	// post commit df95529a5edd0be456b3528b74344be283c4d258
            if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))
                expectedExitCode = new Integer(70);
            ll.add(Arrays.asList(new Object[] { null, username, password, owner, name, type, expectedExitCode, null, expectedStderrRegex }));
        }
    }
    // process all of the rows and change the expected results due to 1461003: Deprecate --type option on register command
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.20.2-1")) {
        // post commit e0c34a729e9e347ab1e0f4f5fa656c8b20205fdf RFE Bug 1461003: Deprecate --type option on register command
        for (List<Object> l : ll) {
            // get the existing BlockedByBzBug
            BlockedByBzBug blockedByBzBug = (BlockedByBzBug) l.get(0);
            ConsumerType type = (ConsumerType) l.get(5);
            if (!type.equals(ConsumerType.system) && !type.equals(ConsumerType.RHUI)) {
                List<String> bugIds = blockedByBzBug == null ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(blockedByBzBug.getBugIds()));
                // Bug 1461003 - [RFE] Remove --type option from subscription-manager register
                bugIds.add("1461003");
                blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
                l.set(0, blockedByBzBug);
                // EX_USAGE
                l.set(6, new Integer(64));
                // stdout
                l.set(7, "");
                // stderr
                l.set(8, "Error: The --type option has been deprecated and may not be used.");
            }
            if (type.equals(ConsumerType.RHUI)) {
                List<String> bugIds = blockedByBzBug == null ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(blockedByBzBug.getBugIds()));
                // Bug 1485008 - subscription-manager register --type="RHUI" or --type="rhui" should both work as documented in various KBase articles
                bugIds.add("1485008");
                blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
                l.set(0, blockedByBzBug);
            }
        }
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) JSONArray(org.json.JSONArray) JSONObject(org.json.JSONObject) ArrayList(java.util.ArrayList) List(java.util.List) JSONObject(org.json.JSONObject) ConsumerType(rhsm.base.ConsumerType) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Example 33 with BlockedByBzBug

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

the class HelpTests method getExpectedCommandLineOptionsDataAsListOfLists.

protected static List<List<Object>> getExpectedCommandLineOptionsDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (clienttasks == null)
        return ll;
    // String command, String stdoutRegex, List<String> expectedOptions
    String command;
    List<String> modules = new ArrayList<String>();
    List<String> options = new ArrayList<String>();
    String module;
    String modulesRegex = "^	[\\w-]+";
    // valid after bug 848095
    modulesRegex = "^  [\\w-]+";
    String optionsRegex = "^  --[\\w\\.]+(=[\\w\\.]+)*|^  -\\w(=\\w+)*, --\\w+(=\\w+)*";
    optionsRegex = "^  --[\\w\\.-]+(=[\\w\\.-]+)*|^  -[\\?\\w]( \\w+)*, --[\\w\\.-]+(=\\w+)*";
    optionsRegex = "^  --[\\w\\.-]+(=[\\w\\.:-]+)*|^  -[\\?\\w]( \\w+)*, --[\\w\\.:-]+(=\\w+)*";
    optionsRegex = "^  --[\\w\\.-]+(=[\\w\\.:,\\-]+)*|^  -[\\?\\w]( \\w+)*, --[\\w\\.:,\\-]+(=\\w+)*";
    // EXAMPLES FOR optionsRegex
    // -h, --help            show this help message and exit
    // --list                list the configuration for this system
    // --remove=REMOVE       remove configuration entry by section.name
    // --server.hostname=SERVER.HOSTNAME
    // -?, --help                  Show help options
    // --help-all                  Show all help options
    // -f, --force-icon=TYPE       Force display of the icon (expired, partial or warning)
    // -c, --check-period          How often to check for validity (in seconds)
    // -i INSTNUMBER, --instnumber=INSTNUMBER
    // --add=NAME:VALUE			name and value of the option to override separated by
    // a colon (can be specified more than once)
    // ========================================================================================
    // subscription-manager MODULES
    modules.clear();
    modules.add("config");
    modules.add("import");
    modules.add("redeem");
    modules.add("orgs");
    modules.add("repos");
    modules.add("clean");
    modules.add("environments");
    modules.add("facts");
    modules.add("identity");
    modules.add("list");
    modules.add("refresh");
    modules.add("register");
    modules.add("subscribe");
    modules.add("unregister");
    modules.add("unsubscribe");
    modules.add("service-level");
    modules.add("release");
    modules.add("version");
    // added by bug 874804
    modules.add("attach");
    // added by bug 874749
    modules.add("remove");
    // added by https://engineering.redhat.com/trac/Entitlement/wiki/SubscriptionManagerPlugins
    modules.add("plugins");
    // added as part of bug 803746
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.10.7-1"))
        modules.add("repo-override");
    modules.add("status");
    // modules.add("autoheal"); changed by Bug 976867 - subscription-manager autoheal needs feedback and a review of options
    modules.add("auto-attach");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h", clienttasks.command + " --help" }) {
        // coverage for bug 906124; the usage statement permits only "--help" and therefore any differing option (including "-h") should return non-zero exit code
        Integer exitCode = smHelpCommand.contains("--help") ? 0 : 1;
        List<String> usages = new ArrayList<String>();
        // prior to Bug 796730 - subscription-manager usage statement
        String usage = String.format("Usage: %s [options] MODULENAME --help", clienttasks.command);
        usage = String.format("Usage: %s MODULE-NAME [MODULE-OPTIONS] [--help]", clienttasks.command);
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "796730", "906124" }), smHelpCommand, exitCode, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "906124" }), smHelpCommand, exitCode, modulesRegex, new ArrayList<String>(modules) }));
    }
    // subscription-manager config OPTIONS
    module = "config";
    options.clear();
    options.add("-h, --help");
    options.add("--list");
    options.add("--remove=REMOVE");
    // add the expected default configurations
    for (String section : new String[] { "server", "rhsm", "rhsmcertd", "logging" /* added by bug 1334916 */
    }) {
        // for (String confFileParameterName : clienttasks.defaultConfFileParameterNames(null)) {	// valid before bug 988476
        for (String confFileParameterName : clienttasks.defaultConfFileParameterNames(section, null)) {
            options.add(String.format("--%s.%s=%s.%s", section.toLowerCase(), confFileParameterName.toLowerCase(), section.toUpperCase(), confFileParameterName.toUpperCase()));
        }
    }
    // add the unexpected configurations that were added manually or remain as deprecated configurations from a subscription-manager upgrade
    String confFileContents = RemoteFileTasks.runCommandAndAssert(client, "egrep -v  \"^\\s*(#|$)\" " + clienttasks.rhsmConfFile, 0).getStdout();
    String section = null;
    for (String line : confFileContents.split("\n")) {
        line = line.trim();
        if (line.isEmpty())
            continue;
        if (line.matches("\\[\\w+\\]")) {
            section = line.replaceFirst("\\[", "").replaceFirst("\\]", "");
            continue;
        }
        String parameterName = line.split("=|:", 2)[0].trim();
        // if (clienttasks.defaultConfFileParameterNames(true).contains(parameterName.toLowerCase())) continue;	// valid before bug 988476
        if (clienttasks.defaultConfFileParameterNames(section, true).contains(parameterName.toLowerCase()))
            continue;
        options.add(String.format("--%s.%s=%s.%s", section.toLowerCase(), parameterName.toLowerCase(), section.toUpperCase(), parameterName.toUpperCase()));
    }
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("919512"), smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager import OPTIONS
    module = "import";
    options.clear();
    options.add("-h, --help");
    // options("--certificate=CERTIFICATE_FILES");	// prior to fix for Bug 735212
    options.add("--certificate=CERTIFICATE_FILE");
    // TEMPORARY WORKAROUND FOR BUG: https://bugzilla.redhat.com/show_bug.cgi?id=733873
    boolean invokeWorkaroundWhileBugIsOpen = true;
    String bugId = "733873";
    try {
        if (invokeWorkaroundWhileBugIsOpen && BzChecker.getInstance().isBugOpen(bugId)) {
            log.fine("Invoking workaround for " + BzChecker.getInstance().getBugState(bugId).toString() + " Bugzilla " + bugId + ".  (https://bugzilla.redhat.com/show_bug.cgi?id=" + bugId + ")");
            SubscriptionManagerCLITestScript.addInvokedWorkaround(bugId);
        } else {
            invokeWorkaroundWhileBugIsOpen = false;
        }
    } catch (BugzillaAPIException be) {
    /* ignore exception */
    } catch (RuntimeException re) {
    /* ignore exception */
    }
    if (invokeWorkaroundWhileBugIsOpen) {
        options.add("--proxy=PROXY_URL");
        options.add("--proxyuser=PROXY_USER");
        options.add("--proxypassword=PROXY_PASSWORD");
    }
    // END OF WORKAROUND
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager redeem OPTIONS
    module = "redeem";
    options.clear();
    options.add("-h, --help");
    options.add("--email=EMAIL");
    options.add("--locale=LOCALE");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager orgs OPTIONS
    module = "orgs";
    options.clear();
    options.add("-h, --help");
    options.add("--serverurl=SERVER_URL");
    options.add("--username=USERNAME");
    options.add("--password=PASSWORD");
    // added by bug 844411
    options.add("--insecure");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager repos OPTIONS
    module = "repos";
    options.clear();
    options.add("-h, --help");
    options.add("--list");
    options.add("--enable=REPOID");
    options.add("--disable=REPOID");
    // added by bug 906642
    options.add("--proxy=PROXY_URL");
    // added by bug 906642
    options.add("--proxyuser=PROXY_USER");
    // added by bug 906642
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.4-1")) {
        // added by bug 1119648
        options.add("--list-enabled");
        // added by bug 1119648
        options.add("--list-disabled");
    }
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager clean OPTIONS
    module = "clean";
    options.clear();
    options.add("-h, --help");
    // options("--proxypassword=PROXY_PASSWORD");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("664581"), smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager environments OPTIONS
    module = "environments";
    options.clear();
    options.add("-h, --help");
    options.add("--serverurl=SERVER_URL");
    options.add("--username=USERNAME");
    options.add("--password=PASSWORD");
    // changed by bug 878097	options.add("--org=ORG");
    options.add("--org=ORG_KEY");
    // added by bug 844411
    options.add("--insecure");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager facts OPTIONS
    module = "facts";
    options.clear();
    options.add("-h, --help");
    options.add("--list");
    options.add("--update");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager identity OPTIONS
    module = "identity";
    options.clear();
    options.add("-h, --help");
    options.add("--username=USERNAME");
    options.add("--password=PASSWORD");
    options.add("--regenerate");
    options.add("--force");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager list OPTIONS
    module = "list";
    options.clear();
    options.add("-h, --help");
    // result of https://bugzilla.redhat.com/show_bug.cgi?id=634254
    options.add("--installed");
    options.add("--consumed");
    options.add("--available");
    options.add("--all");
    // result of https://bugzilla.redhat.com/show_bug.cgi?id=800999
    options.add("--servicelevel=SERVICE_LEVEL");
    // result of https://bugzilla.redhat.com/show_bug.cgi?id=672562
    options.add("--ondate=ON_DATE");
    // added by Bug 654501 - [RFE] subscription-manager list should accept filtering
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.10.3-1"))
        options.add("--no-overlap");
    // added by Bug 654501 - [RFE] subscription-manager list should accept filtering
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.10.3-1"))
        options.add("--match-installed");
    // added by Bug 1146125 - [RFE] would like a --contains-text option for subscription-manager list module
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.6-1"))
        options.add("--matches=FILTER_STRING");
    // added by Bug 1159974 - RFE: Add a --pool-only option to the list subcommand	// commit 25cb581cb6ebe13063d0f78a5020715a2854d337
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))
        options.add("--pool-only");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager status OPTIONS
    module = "status";
    options.clear();
    options.add("-h, --help");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    // subscription-manager commit 957f3f5fb4689f22355e0101185bd560e67f3462
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.9.2-1"))
        options.add("--ondate=ON_DATE");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("977481"), smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager refresh OPTIONS
    module = "refresh";
    options.clear();
    options.add("-h, --help");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager register OPTIONS
    module = "register";
    options.clear();
    options.add("-h, --help");
    options.add("--baseurl=BASE_URL");
    options.add("--serverurl=SERVER_URL");
    options.add("--username=USERNAME");
    // changed by bug 874816	options.add("--type=CONSUMERTYPE");
    options.add("--type=UNITTYPE");
    // changed by bug 874816	options.add("--name=CONSUMERNAME");
    options.add("--name=SYSTEMNAME");
    options.add("--password=PASSWORD");
    // changed by bug 874816	options.add("--consumerid=CONSUMERID");
    options.add("--consumerid=SYSTEMID");
    // changed by bug 878097	options.add("--org=ORG");
    options.add("--org=ORG_KEY");
    options.add("--environment=ENVIRONMENT");
    options.add("--autosubscribe");
    // added by bug 876340
    options.add("--auto-attach");
    // added by bug 844411
    options.add("--insecure");
    options.add("--force");
    // Bug 874755 - help message terminology for cli options that can be specified in multiplicity
    options.add("--activationkey=ACTIVATION_KEYS");
    options.add("--servicelevel=SERVICE_LEVEL");
    options.add("--release=RELEASE");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    // removed by bug 1461003 commit e0c34a729e9e347ab1e0f4f5fa656c8b20205fdf
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.20.2-1"))
        options.remove("--type=UNITTYPE");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("628589"), smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager unregister OPTIONS
    module = "unregister";
    options.clear();
    options.add("-h, --help");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager subscribe OPTIONS
    module = "subscribe";
    options.clear();
    options.add("-h, --help");
    options.add("--pool=POOL");
    options.add("--quantity=QUANTITY");
    // result of https://bugzilla.redhat.com/show_bug.cgi?id=680399
    options.add("--auto");
    options.add("--servicelevel=SERVICE_LEVEL");
    // added by Bug 1159974 // commit 3167333fc3a261de939f4aa0799b4283f2b9f4d2
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))
        options.add("--file=FILE");
    // options("--regtoken=REGTOKEN");	// https://bugzilla.redhat.com/show_bug.cgi?id=670823
    // options("--email=EMAIL");			// https://bugzilla.redhat.com/show_bug.cgi?id=670823
    // options("--locale=LOCALE");		// https://bugzilla.redhat.com/show_bug.cgi?id=670823
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        // added by bug 874808
        String deprecation = "Deprecated, see attach";
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, "^" + deprecation + "$", Arrays.asList(new String[] { deprecation }) }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager attach OPTIONS	// added by bug 874804
    module = "attach";
    options.clear();
    options.add("-h, --help");
    options.add("--pool=POOL");
    options.add("--quantity=QUANTITY");
    options.add("--auto");
    options.add("--servicelevel=SERVICE_LEVEL");
    // added by Bug 1159974 // commit 3167333fc3a261de939f4aa0799b4283f2b9f4d2
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.13.8-1"))
        options.add("--file=FILE");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        usages.add(usage);
        String deprecation = "Attach a specified subscription to the registered system";
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, "^" + deprecation + "$", Arrays.asList(new String[] { deprecation }) }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager unsubscribe OPTIONS
    module = "unsubscribe";
    options.clear();
    options.add("-h, --help");
    // Bug 874755 - help message terminology for cli options that can be specified in multiplicity
    options.add("--serial=SERIAL");
    options.add("--all");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    // added by Bug 1198178 - [RFE] Subscription-manager unsubscribe command should support --pool option	// commit 3d2eb4b8ef8e2094311e3872cdb9602b84fed9be
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.16.5-1"))
        options.add("--pool=POOL_ID");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        // added by bug 874749
        String deprecation = "Deprecated, see remove";
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, "^" + deprecation + "$", Arrays.asList(new String[] { deprecation }) }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager remove OPTIONS	// added by bug 874749
    module = "remove";
    options.clear();
    options.add("-h, --help");
    options.add("--serial=SERIAL");
    options.add("--all");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    // added by Bug 1198178 - [RFE] Subscription-manager unsubscribe command should support --pool option	// commit 3d2eb4b8ef8e2094311e3872cdb9602b84fed9be
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.16.5-1"))
        options.add("--pool=POOL_ID");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        usages.add(usage);
        String deprecation = "Remove all or specific subscriptions from this system";
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, "^" + deprecation + "$", Arrays.asList(new String[] { deprecation }) }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager service-level OPTIONS
    module = "service-level";
    options.clear();
    options.add("-h, --help");
    options.add("--serverurl=SERVER_URL");
    options.add("--username=USERNAME");
    options.add("--password=PASSWORD");
    // changed by bug 878097	options.add("--org=ORG");
    options.add("--org=ORG_KEY");
    options.add("--show");
    options.add("--list");
    options.add("--set=SERVICE_LEVEL");
    options.add("--unset");
    // added by bug 844411
    options.add("--insecure");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager release OPTIONS
    module = "release";
    options.clear();
    options.add("-h, --help");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    options.add("--set=RELEASE");
    options.add("--list");
    options.add("--unset");
    // Bug 812153 - release command should have a --show option which is the default
    options.add("--show");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager plugins OPTIONS
    module = "plugins";
    options.clear();
    options.add("-h, --help");
    options.add("--list");
    options.add("--listslots");
    options.add("--listhooks");
    options.add("--verbose");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager repo-override OPTIONS
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.10.7-1")) {
        // introduced by RFE Bug 803746
        module = "repo-override";
        options.clear();
        options.add("-h, --help");
        options.add("--proxy=PROXY_URL");
        options.add("--proxyuser=PROXY_USER");
        options.add("--proxypassword=PROXY_PASSWORD");
        // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
        if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
            options.add("--noproxy=NO_PROXY");
        options.add("--repo=REPOID");
        options.add("--remove=NAME");
        options.add("--add=NAME:VALUE");
        options.add("--remove-all");
        options.add("--list");
        for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
            List<String> usages = new ArrayList<String>();
            String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
            // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
            usages.add(usage);
            ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("977481"), smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
        }
    }
    // subscription-manager version OPTIONS
    module = "version";
    options.clear();
    options.add("-h, --help");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("977481"), smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager auto-attach OPTIONS
    // module = "autoheal";	// changed by Bug 976867 - subscription-manager autoheal needs feedback and a review of options
    module = "auto-attach";
    options.clear();
    options.add("-h, --help");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    options.add("--show");
    options.add("--enable");
    options.add("--disable");
    for (String smHelpCommand : new String[] { clienttasks.command + " -h " + module, clienttasks.command + " --help " + module }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", clienttasks.command, module);
        // if (clienttasks.redhatRelease.contains("release 5")) usage = usage.replaceFirst("^Usage", "usage"); // TOLERATE WORKAROUND FOR Bug 693527 ON RHEL5
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("976867"), smHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("976867"), smHelpCommand, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // subscription-manager-gui OPTIONS
    if (!client.runCommandAndWait("rpm -q " + clienttasks.command + "-gui").getStdout().contains("is not installed")) {
        // test only when the rpm is installed
        // [root@jsefler-6 ~]# subscription-manager-gui --help
        // Usage: subscription-manager-gui [OPTIONS]
        // 
        // Options:
        // -h, --help  show this help message and exit
        // --register  launches the registration dialog on startup.
        command = clienttasks.command + "-gui";
        options.clear();
        options.add("-h, --help");
        options.add("--register");
        for (String commandHelp : new String[] { command + " -h", command + " --help" }) {
            // solution: try several until one works and then use it
            for (String exportDisplay : Arrays.asList(new String[] { "export DISPLAY=localhost:2", "export DISPLAY=localhost:10.0", "export DISPLAY=localhost:11.0", "export DISPLAY=:0" })) {
                String commandHelpWithExportDisplay = exportDisplay + " && " + commandHelp;
                if (client.runCommandAndWait(commandHelpWithExportDisplay).getStdout().trim().startsWith("Usage")) {
                    commandHelp = commandHelpWithExportDisplay;
                    break;
                }
            }
            List<String> usages = new ArrayList<String>();
            String usage = String.format("Usage: %s [OPTIONS]", command);
            usages.add(usage);
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "881095", "905649" }), commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\|", "\\\\|").replaceAll("\\?", "\\\\?") + " *$", usages }));
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "881095", "905649" }), commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
        }
    }
    // rhsm-icon OPTIONS
    if (!client.runCommandAndWait("rpm -q " + clienttasks.command + "-gui").getStdout().contains("is not installed")) {
        // test only when the rpm is installed
        // [root@jsefler-onprem-5server ~]# rhsm-icon -?
        // Usage:
        // rhsm-icon [OPTION...] rhsm icon
        // 
        // Help Options:
        // -?, --help                  Show help options
        // --help-all                  Show all help options
        // --help-gtk                  Show GTK+ Options
        // 
        // Application Options:
        // -c, --check-period          How often to check for validity (in seconds)
        // -d, --debug                 Show debug messages
        // -f, --force-icon=TYPE       Force display of the icon (expired, partial or warning)
        // -i, --check-immediately     Run the first status check right away
        // --display=DISPLAY           X display to use
        command = "rhsm-icon";
        List<String> rhsmIconOptions = new ArrayList<String>();
        if (// rhel5
        clienttasks.redhatReleaseX.equals("5"))
            // rhel5
            rhsmIconOptions.add("-?, --help");
        else
            // rhel6
            rhsmIconOptions.add("-h, --help");
        rhsmIconOptions.add("--help-all");
        rhsmIconOptions.add("--help-gtk");
        rhsmIconOptions.add("-c, --check-period");
        rhsmIconOptions.add("-d, --debug");
        rhsmIconOptions.add("-f, --force-icon=TYPE");
        rhsmIconOptions.add("-i, --check-immediately");
        rhsmIconOptions.add("--display=DISPLAY");
        for (String helpOption : rhsmIconOptions.get(0).split(" *, *")) {
            // "-?, --help"
            String rhsmIconHelpCommand = command + " " + helpOption;
            List<String> usages = new ArrayList<String>();
            String usage = command + " [OPTIONS]";
            // usage = rhsmIconCommand+" [OPTION...] rhsm icon"; // Bug 771756 - rhsm-icon --help usage message is misleading
            usage = command + " [OPTION...]";
            usages.add(usage);
            if (// skip the following rhsmIconHelpCommand usage test since bug 771756 was not fixed until 5.9
            !Arrays.asList("6.1", "5.7", "6.2", "5.8", "6.3").contains(clienttasks.redhatReleaseXY))
                ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("771756"), rhsmIconHelpCommand, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
            ll.add(Arrays.asList(new Object[] { null, rhsmIconHelpCommand, 0, optionsRegex, rhsmIconOptions }));
        }
        List<String> rhsmIconGtkOptions = new ArrayList<String>();
        rhsmIconGtkOptions.add("--screen=SCREEN");
        // GTK options are presented here: http://developer.gnome.org/gtk-tutorial/2.90/c39.html
        rhsmIconGtkOptions.add("--class=CLASS");
        rhsmIconGtkOptions.add("--name=NAME");
        rhsmIconGtkOptions.add("--display=DISPLAY");
        rhsmIconGtkOptions.add("--sync");
        rhsmIconGtkOptions.add("--gtk-module=MODULES");
        rhsmIconGtkOptions.add("--g-fatal-warnings");
        if (!clienttasks.redhatReleaseX.equals("5"))
            rhsmIconGtkOptions.add("--gdk-debug=FLAGS");
        if (!clienttasks.redhatReleaseX.equals("5"))
            rhsmIconGtkOptions.add("--gdk-no-debug=FLAGS");
        if (!clienttasks.redhatReleaseX.equals("5"))
            rhsmIconGtkOptions.add("--gtk-debug=FLAGS");
        if (!clienttasks.redhatReleaseX.equals("5"))
            rhsmIconGtkOptions.add("--gtk-no-debug=FLAGS");
        if (client.runCommandAndWait("rpm -qf `which rhsm-icon` --requires | egrep '^(gtk|pygtk)'").getStdout().trim().startsWith("gtk3")) {
            // if (clienttasks.isPackageVersion("subscription-manager",">=","1.15.3")) {	// commit 3c51d2096ecdd1a7ba6981776bd9aa6959aa2e1e use gtk3 for rhsm-icon
            // effectively this happens on RHEL >= 7.2
            // options not offered by gtk3
            rhsmIconGtkOptions.remove("--screen=SCREEN");
            rhsmIconGtkOptions.remove("--sync");
        }
        ll.add(Arrays.asList(new Object[] { null, command + " --help-gtk", 0, optionsRegex, rhsmIconGtkOptions }));
        List<String> rhsmIconAllOptions = new ArrayList<String>();
        rhsmIconAllOptions.addAll(rhsmIconOptions);
        rhsmIconAllOptions.addAll(rhsmIconGtkOptions);
        ll.add(Arrays.asList(new Object[] { null, command + " --help-all", 0, optionsRegex, rhsmIconAllOptions }));
    }
    // rhn-migrate-classic-to-rhsm OPTIONS
    if (!client.runCommandAndWait("rpm -q " + clienttasks.command + "-migration").getStdout().contains("is not installed")) {
        // test only when the rpm is installed
        // [root@jsefler-onprem-5server ~]# rhn-migrate-classic-to-rhsm -h
        // usage: /usr/sbin/rhn-migrate-classic-to-rhsm [--force|--cli-only|--help|--no-auto]
        // 
        // options:
        // -f, --force     Ignore Channels not available on RHSM
        // -c, --cli-only  Don't launch the GUI tool to subscribe the system, just use
        // the CLI tool which will do it automatically
        // -n, --no-auto   Don't launch subscription manager at end of process.
        // -h, --help      show this help message and exit
        command = MigrationTests.rhnMigrateTool;
        options.clear();
        options.add("-f, --force");
        options.add("-g, --gui");
        options.add("-n, --no-auto");
        options.add("-s SERVICELEVEL, --servicelevel=SERVICELEVEL");
        options.add("--serverurl=SERVERURL");
        // added by Bug 915847 - rhn-migrate-classic-to-rhsm fails when used with a proxy with an internal SAM
        options.add("--no-proxy");
        // added by Bug 877331 - missing --org --environment arguments for migration script
        options.add("--org=ORG");
        // added by Bug 877331 - missing --org --environment arguments for migration script
        options.add("--environment=ENVIRONMENT");
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.10.3-1")) {
            // added by Bug 912375 - RFE - "rhn-migrate-classic-to-rhsm" migration script to accept the expected parameter either via standard input or the equivalent of an "answer" file"
            options.add("--redhat-user=REDHATUSER");
            options.add("--redhat-password=REDHATPASSWORD");
            options.add("--subscription-service-user=SUBSERVICEUSER");
            options.add("--subscription-service-password=SUBSERVICEPASSWORD");
        }
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.13.1")) {
            options.remove("--redhat-user=REDHATUSER");
            options.remove("--redhat-password=REDHATPASSWORD");
            options.remove("--subscription-service-user=SUBSERVICEUSER");
            options.remove("--subscription-service-password=SUBSERVICEPASSWORD");
            options.remove("--serverurl=SERVERURL");
            options.remove("-s SERVICELEVEL, --servicelevel=SERVICELEVEL");
            options.remove("-g, --gui");
            options.add("--legacy-user=LEGACY_USER");
            options.add("--legacy-password=LEGACY_PASSWORD");
            options.add("--destination-user=DESTINATION_USER");
            options.add("--destination-password=DESTINATION_PASSWORD");
            options.add("--destination-url=DESTINATION_URL");
            options.add("-s SERVICE_LEVEL, --service-level=SERVICE_LEVEL");
        }
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.13.8")) {
            // commit e53f0369b621902b75f2dbe047d97dc9ba3cc1c0  revert for bug 1157761
            options.remove("-s SERVICE_LEVEL, --service-level=SERVICE_LEVEL");
            options.add("-s SERVICE_LEVEL, --servicelevel=SERVICE_LEVEL");
        }
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.14.1-1")) {
            // commit 00461f3751f9db182227c9973c41b305e378638a  RFE Bug 1154375: Allow use of activation keys during migration.
            options.add("--activation-key=ACTIVATION_KEYS");
        }
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.14.3-1")) {
            // commit 5df7aaaa69a22b9e3f771971f1aa4e58657c8377	RFE Bug 1180273 - [RFE] rhn-migrate-classic-to-rhsm should allow the user to migrate a system without requiring credentials on RHN Classic
            options.add("--registration-state=keep,purge");
        }
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.14.6-1")) {
            // commit 6eded942a7d184ef7ed92bbd94225120ee2f2f20	RFE Bug 1180273 - [RFE] rhn-migrate-classic-to-rhsm should allow the user to migrate a system without requiring credentials on RHN Classic
            options.remove("--registration-state=keep,purge");
            options.add("--keep");
        }
        if (clienttasks.isPackageVersion("subscription-manager-migration", ">=", "1.18.2-1")) {
            // commit 871264dbb0cc091d3eaefabfdfd2e51d6bbc0a3c	RFE Bug 1185914 - [RFE] rhn-migrate-classic-to-rhsm should give the option to remove RHN Classic related packages / daemon
            options.add("--remove-rhn-packages");
        }
        options.add("-h, --help");
        for (String commandHelp : new String[] { command + " -h", command + " --help" }) {
            List<String> usages = new ArrayList<String>();
            String usage = String.format("usage: %s [OPTIONS]", command);
            usage = String.format("Usage: %s [OPTIONS]", command);
            usages.add(usage);
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1052297"), commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\|", "\\\\|").replaceAll("\\?", "\\\\?") + " *$", usages }));
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1052297"), commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
        }
    }
    // install-num-migrate-to-rhsm OPTIONS
    if (!client.runCommandAndWait("rpm -q " + clienttasks.command + "-migration").getStdout().contains("is not installed")) {
        // test only when the rpm is installed
        if (clienttasks.redhatReleaseX.equals("5")) {
            // test only on RHEL5
            if (clienttasks.isPackageVersion("subscription-manager-migration", "<=", "1.11.3-4")) {
                // install-num-migrate-to-rhsm was removed by bug 1092754
                // [root@jsefler-onprem-5server ~]# install-num-migrate-to-rhsm --help
                // usage: install-num-migrate-to-rhsm [options]
                // 
                // options:
                // -h, --help            show this help message and exit
                // -i INSTNUMBER, --instnumber=INSTNUMBER
                // Install number to run against
                // -d, --dryrun          Only print the files which would be copied over
                command = MigrationTests.installNumTool;
                options.clear();
                options.add("-h, --help");
                options.add("-i INSTNUMBER, --instnumber=INSTNUMBER");
                options.add("-d, --dryrun");
                for (String commandHelp : new String[] { command + " -h", command + " --help" }) {
                    List<String> usages = new ArrayList<String>();
                    String usage = String.format("usage: %s [options]", command);
                    // changed by bug 876692
                    usage = String.format("Usage: %s [OPTIONS]", command);
                    usages.add(usage);
                    ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\|", "\\\\|").replaceAll("\\?", "\\\\?") + " *$", usages }));
                    ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
                }
            }
        }
    }
    // ========================================================================================
    // rhsmcertd OPTIONS
    // [root@nec-em15 ~]# rhsmcertd -?
    // Usage:
    // rhsmcertd [OPTION...]
    // 
    // Help Options:
    // -?, --help                      Show help options
    // --help-all                      Show all help options
    // --help-rhsmcertd                rhsmcertd
    // 
    // Application Options:
    // -c, --cert-interval=MINUTES     Interval to run cert check (in minutes)
    // -i, --heal-interval=MINUTES     Interval to run healing (in minutes)
    // -n, --now                       Run the initial checks immediatly, with no delay.
    // -d, --debug                     Show debug messages
    command = clienttasks.rhsmCertD;
    options.clear();
    if (// rhel5	// this logic is also needed in TranslationTests.getTranslatedCommandLineHelpDataAsListOfLists()
    clienttasks.redhatReleaseX.equals("5"))
        // rhel5	// this logic is also needed in TranslationTests.getTranslatedCommandLineHelpDataAsListOfLists()
        options.add("-?, --help");
    else
        // rhel6
        options.add("-h, --help");
    // options.add("--help-all");		// removed by Bug 842020 - what is rhsmcertd --help-rhsmcertd?
    // options.add("--help-rhsmcertd");	// removed by Bug 842020 - what is rhsmcertd --help-rhsmcertd?
    // updated by bug 882459	options.add("-c, --cert-interval=MINUTES");
    options.add("-c, --cert-check-interval=MINUTES");
    // added by bug 882459 as a deprecated, see --cert-check-interval
    options.add("--cert-interval=MINUTES");
    // updated by bug 876753	options.add("-i, --heal-interval=MINUTES");
    options.add("-i, --auto-attach-interval=MINUTES");
    // added by bug 876753 as a deprecated, see --auto-attach-interval
    options.add("--heal-interval=MINUTES");
    options.add("-n, --now");
    options.add("-d, --debug");
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.19.8-1")) {
        // commit e9f8421285fc6541166065a8b55ee89b9a425246	RFE Bug 1435013: Add splay option to rhsmcertd, randomize over interval
        // do not add an offset to the initial checks.
        options.add("-s, --no-splay");
    }
    for (String helpOption : options.get(0).split(" *, *")) {
        // "-?, --help"
        String commandHelp = command + " " + helpOption;
        List<String> usages = new ArrayList<String>();
        String usage = command + " [OPTIONS]";
        usage = command + " [OPTION...]";
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "876753", "882459" }), commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // ========================================================================================
    // /usr/libexec/rhsmd OPTIONS
    // [root@jsefler-6 ~]# /usr/libexec/rhsmd --help
    // Usage: rhsmd [options]
    // 
    // Options:
    // -h, --help            show this help message and exit
    // -d, --debug           Display debug messages
    // -k, --keep-alive      Stay running (don't shut down after the first dbus
    // call)
    // -s, --syslog          Run standalone and log result to syslog
    // -f FORCE_SIGNAL, --force-signal=FORCE_SIGNAL
    // Force firing of a signal (valid, expired, warning,
    // partial, classic or registration_required)
    // -i, --immediate       Fire forced signal immediately (requires --force-
    // signal)
    command = clienttasks.rhsmComplianceD;
    options.clear();
    options.add("-h, --help");
    options.add("-d, --debug");
    options.add("-k, --keep-alive");
    options.add("-s, --syslog");
    options.add("-f FORCE_SIGNAL, --force-signal=FORCE_SIGNAL");
    options.add("-i, --immediate");
    for (String commandHelp : new String[] { command + " -h", command + " --help" }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s [options]", command.replaceFirst("/.+/", ""));
        // changed by bug 876692
        usage = String.format("Usage: %s [OPTIONS]", command.replaceFirst("/.+/", ""));
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // ========================================================================================
    // /usr/libexec/rhsmcertd-worker OPTIONS
    // [root@jsefler-6 ~]# /usr/libexec/rhsmcertd-worker --help
    // Usage: rhsmcertd-worker [options]
    // 
    // Options:
    // -h, --help  show this help message and exit
    // --autoheal  perform an autoheal check
    command = clienttasks.rhsmCertDWorker;
    options.clear();
    options.add("-h, --help");
    options.add("--autoheal");
    for (String commandHelp : new String[] { command + " -h", command + " --help" }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s [options]", command.replaceFirst("/.+/", ""));
        // changed by bug 876692
        usage = String.format("Usage: %s [OPTIONS]", command.replaceFirst("/.+/", ""));
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // ========================================================================================
    // rct MODULES
    // [root@jsefler-rhel59 ~]# rct --help
    // 
    // Usage: rct MODULE-NAME [MODULE-OPTIONS] [--help]
    // 
    // 
    // Primary Modules:
    // 
    // cat-cert       Print certificate info to standard output.
    // 
    // Other Modules (Please consult documentation):
    command = "rct";
    modules.clear();
    modules.add("cat-cert");
    modules.add("stat-cert");
    modules.add("cat-manifest");
    modules.add("dump-manifest");
    for (String commandHelp : new String[] { command + " -h", command + " --help" }) {
        // coverage for bug 906124; the usage statement permits only "--help" and therefore any differing option (including "-h") should return non-zero exit code
        Integer exitCode = commandHelp.contains("--help") ? 0 : 1;
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s MODULE-NAME [MODULE-OPTIONS] [--help]", command);
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("906124"), commandHelp, exitCode, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("906124"), commandHelp, exitCode, modulesRegex, new ArrayList<String>(modules) }));
    }
    // rct cat-cert OPTIONS
    // [root@jsefler-rhel59 ~]# rct cat-cert --help
    // Usage: rct cat-cert [OPTIONS] CERT_FILE
    // 
    // Print certificate info to standard output.
    // 
    // options:
    // -h, --help     show this help message and exit
    // --no-products  do not show the cert's product information
    // --no-content   do not show the cert's content info.
    module = "cat-cert";
    options.clear();
    options.add("-h, --help");
    options.add("--no-products");
    options.add("--no-content");
    for (String commandHelp : new String[] { command + " " + module + " -h", command + " " + module + " --help" }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS] CERT_FILE", command, module);
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // rct stat-cert OPTIONS
    // [root@jsefler-6 ~]# rct stat-cert --help
    // Usage: rct stat-cert [OPTIONS] CERT_FILE
    // 
    // Print certificate statistics and sizes
    // 
    // Options:
    // -h, --help  show this help message and exit
    module = "stat-cert";
    options.clear();
    options.add("-h, --help");
    for (String commandHelp : new String[] { command + " " + module + " -h", command + " " + module + " --help" }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS] CERT_FILE", command, module);
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // rct cat-manifest OPTIONS
    // [root@jsefler-7 ~]# rct cat-manifest --help
    // Usage: rct cat-manifest [OPTIONS] MANIFEST_FILE
    // 
    // Print manifest information
    // 
    // Options:
    // -h, --help  show this help message and exit
    module = "cat-manifest";
    options.clear();
    options.add("-h, --help");
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.17.10-1")) {
        // RHEL7.3 commit 860b178e0eb5b91df01c424dad29c521e1c23767  Bug 1336883 - [RFE] Update the 'rct' command to allow not outputting content-set data
        options.add("--no-content");
    }
    for (String commandHelp : new String[] { command + " " + module + " -h", command + " " + module + " --help" }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS] MANIFEST_FILE", command, module);
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // rct dump-manifest OPTIONS
    // [root@jsefler-7 ~]# rct dump-manifest --help
    // Usage: rct dump-manifest [OPTIONS] MANIFEST_FILE
    // 
    // Dump the contents of a manifest
    // 
    // Options:
    // -h, --help            show this help message and exit
    // --destination=DESTINATION
    // directory to extract the manifest to
    module = "dump-manifest";
    options.clear();
    options.add("-h, --help");
    options.add("--destination=DESTINATION");
    // added by Bug 961124 - attempt to rct dump-manifest twice throws traceback
    options.add("-f, --force");
    for (String commandHelp : new String[] { command + " " + module + " -h", command + " " + module + " --help" }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS] MANIFEST_FILE", command, module);
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { null, commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    // ========================================================================================
    // rhsm-debug MODULES
    // [root@jsefler-7 ~]# rhsm-debug --help
    // Usage: rhsm-debug MODULE-NAME [MODULE-OPTIONS] [--help]
    // 
    // Other Modules:
    // 
    // system         None	// Bug 1039907 - Need Description for rhsm-debug system option
    command = "rhsm-debug";
    modules.clear();
    modules.add("system");
    for (String commandHelp : new String[] { command + " -h", command + " --help" }) {
        // coverage for bug 906124; the usage statement permits only "--help" and therefore any differing option (including "-h") should return non-zero exit code
        Integer exitCode = commandHelp.contains("--help") ? 0 : 1;
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s MODULE-NAME [MODULE-OPTIONS] [--help]", command);
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1039653"), commandHelp, exitCode, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1039653"), commandHelp, exitCode, modulesRegex, new ArrayList<String>(modules) }));
    }
    // rhsm-debug system OPTIONS
    // [root@jsefler-7 ~]# rhsm-debug system --help
    // Usage: rhsm-debug system [OPTIONS]
    // 
    // Assemble system information as a tar file or directory
    // 
    // Options:
    // -h, --help            show this help message and exit
    // --proxy=PROXY_URL     proxy URL in the form of proxy_hostname:proxy_port
    // --proxyuser=PROXY_USER
    // user for HTTP proxy with basic authentication
    // --proxypassword=PROXY_PASSWORD
    // password for HTTP proxy with basic authentication
    // --destination=DESTINATION
    // the destination location of the result; default is
    // /tmp
    // --no-archive          data will be in an uncompressed directory
    module = "system";
    options.clear();
    options.add("-h, --help");
    options.add("--proxy=PROXY_URL");
    options.add("--proxyuser=PROXY_USER");
    options.add("--proxypassword=PROXY_PASSWORD");
    // added by bug 1420533 commit bd8b0538d7b0be7ee1e666ad5a66df80962c67d9
    if (clienttasks.isPackageVersion("python-rhsm", ">=", "1.19.4-1"))
        options.add("--noproxy=NO_PROXY");
    // https://bugzilla.redhat.com/show_bug.cgi?id=1040338#c2
    options.add("--destination=DESTINATION");
    options.add("--no-archive");
    // added by Bug 1060727 - rhsm-debug duplicates sos data and may collect secrets
    options.add("--sos");
    // added by Bug 1114117 - rhsm-debug takes forever	// commit 68a1a418c27172c4fb851d536813f8060f4d3d1f
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.12.7-1"))
        options.add("--no-subscriptions");
    // added by 	1114117: Stop collecting subs info by default.	// commit 029f786999f5b1cd1d9614976fb4544ca6541b3b
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.14.1-1"))
        options.add("--subscriptions");
    // removed by https://bugzilla.redhat.com/show_bug.cgi?id=1246680#c2 	// commit 6bd472d13d88934e3a3069862e26f9e7e27bec8c
    if (clienttasks.isPackageVersion("subscription-manager", ">=", "1.15.9-12")) {
        options.remove("--no-subscriptions");
        options.remove("--subscriptions");
    }
    for (String commandHelp : new String[] { command + " " + module + " -h", command + " " + module + " --help" }) {
        List<String> usages = new ArrayList<String>();
        String usage = String.format("Usage: %s %s [OPTIONS]", command, module);
        usages.add(usage);
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1039653"), commandHelp, 0, usage.replaceAll("\\[", "\\\\[").replaceAll("\\]", "\\\\]").replaceAll("\\?", "\\\\?") + " *$", usages }));
        ll.add(Arrays.asList(new Object[] { new BlockedByBzBug("1039653"), commandHelp, 0, optionsRegex, new ArrayList<String>(options) }));
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BugzillaAPIException(com.redhat.qe.auto.bugzilla.BugzillaAPIException) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Example 34 with BlockedByBzBug

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

the class InstanceTests method getAvailableInstanceBasedSubscriptionPoolsDataAsListOfLists.

protected List<List<Object>> getAvailableInstanceBasedSubscriptionPoolsDataAsListOfLists() throws JSONException, Exception {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    Map<String, Integer> poolProductIdsQuantityMap = new HashMap<String, Integer>();
    for (List<Object> list : getAvailableSubscriptionPoolsDataAsListOfLists(false)) {
        SubscriptionPool pool = (SubscriptionPool) (list.get(0));
        // skip unmapped_guests_only pools
        if (CandlepinTasks.isPoolRestrictedToUnmappedVirtualSystems(sm_clientUsername, sm_clientPassword, sm_serverUrl, pool.poolId)) {
            continue;
        }
        // test auto-subscribing across multiple instance_multiplier pools
        if (poolProductIdsQuantityMap.containsKey(pool.productId)) {
            // the fact that we are here means that there are multiple pools available for the same instance-based product subscription
            // let's try testing cpu_sockets size that will require entitlements from both pools when auto-subscribing
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "963227" /*,"964332"*/
            }), false, Integer.valueOf(Math.max(poolProductIdsQuantityMap.get(pool.productId), Integer.valueOf(pool.quantity))) + 2, pool }));
            ll.add(Arrays.asList(new Object[] { new BlockedByBzBug(new String[] { "963227" /*,"964332"*/
            }), false, Integer.valueOf(pool.quantity) + poolProductIdsQuantityMap.get(pool.productId), pool }));
            poolProductIdsQuantityMap.put(pool.productId, Integer.valueOf(pool.quantity) + poolProductIdsQuantityMap.get(pool.productId));
            continue;
        }
        // test instance_multiplier pools
        if (CandlepinTasks.isPoolProductInstanceBased(sm_clientUsername, sm_clientPassword, sm_serverUrl, pool.poolId)) {
            BlockedByBzBug blockedByBzBug = null;
            // Bug 1046158 - Attaching quantity=1 of SKU RH00073 on a 2 socket physical system yields "Only covers 0 of 2 sockets."
            if (pool.productId.equals("RH00073"))
                blockedByBzBug = new BlockedByBzBug("1046158");
            // Object bugzilla, Boolean is_guest, String cpu_sockets, SubscriptionPool pool
            ll.add(Arrays.asList(new Object[] { blockedByBzBug, false, new Integer(1), pool }));
            ll.add(Arrays.asList(new Object[] { blockedByBzBug, false, new Integer(2), pool }));
            ll.add(Arrays.asList(new Object[] { blockedByBzBug, false, new Integer(5), pool }));
            ll.add(Arrays.asList(new Object[] { null, true, new Integer(1), pool }));
            ll.add(Arrays.asList(new Object[] { null, true, new Integer(2), pool }));
            ll.add(Arrays.asList(new Object[] { null, true, new Integer(5), pool }));
            // keep a quantity map of the instance based pools we are testing
            poolProductIdsQuantityMap.put(pool.productId, Integer.valueOf(pool.quantity));
            continue;
        }
    }
    return ll;
}
Also used : BigInteger(java.math.BigInteger) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) SubscriptionPool(rhsm.data.SubscriptionPool) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug)

Example 35 with BlockedByBzBug

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

the class DockerTests method getSubscriptionManagementCommandDataAsListOfLists.

protected List<List<Object>> getSubscriptionManagementCommandDataAsListOfLists() {
    List<List<Object>> ll = new ArrayList<List<Object>>();
    if (!isSetupBeforeSuiteComplete)
        return ll;
    Set<String> commands = new HashSet<String>();
    for (List<Object> l : HelpTests.getExpectedCommandLineOptionsDataAsListOfLists()) {
        // Object bugzilla, String helpCommand, Integer exitCode, String stdoutRegex, List<String> expectedOptions
        // BlockedByBzBug blockedByBzBug = (BlockedByBzBug) l.get(0);
        String helpCommand = (String) l.get(1);
        // only process the commands with modules for which --help is an option
        if (!helpCommand.contains("--help"))
            continue;
        // remove the --help option
        String command = helpCommand.replace("--help", "");
        // collapse white space and trim
        command = command.replaceAll(" +", " ").trim();
        // skip command "subscription-manager"
        if (command.equals(clienttasks.command))
            continue;
        // skip command "rhsm-debug"
        if (command.equals("rhsm-debug"))
            continue;
        // skip command "rct"
        if (command.startsWith("rct"))
            continue;
        // skip command "rhsm-icon"
        if (command.startsWith("rhsm-icon"))
            continue;
        // skip command "usr/libexec/rhsmd"
        if (command.startsWith("/usr/libexec/rhsmd"))
            continue;
        // skip command "usr/libexec/rhsmcertd-worker"
        if (command.startsWith("/usr/libexec/rhsmcertd-worker"))
            continue;
        // skip duplicate commands
        if (commands.contains(command))
            continue;
        else
            commands.add(command);
        Set<String> bugIds = new HashSet<String>();
        // Bug 1114132 - when in container mode, subscription-manager-gui (and some other tools) should also be disabled
        if (command.contains("subscription-manager-gui"))
            bugIds.add("1114132");
        if (command.startsWith("rhn-migrate-classic-to-rhsm"))
            bugIds.add("1114132");
        if (command.startsWith("rhsmcertd"))
            bugIds.add("1114132");
        BlockedByBzBug blockedByBzBug = new BlockedByBzBug(bugIds.toArray(new String[] {}));
        ll.add(Arrays.asList(new Object[] { blockedByBzBug, command }));
    }
    return ll;
}
Also used : ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) BlockedByBzBug(com.redhat.qe.auto.bugzilla.BlockedByBzBug) HashSet(java.util.HashSet)

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