"""Smoke tests to check installation health

:Requirement: Installer

:CaseAutomation: Automated

:CaseLevel: Acceptance

:CaseComponent: Installer

:TestType: Functional

:CaseImportance: High

:Upstream: No
"""
import re
from six.moves import zip

from robottelo import ssh
from robottelo.config import settings
from robottelo.constants import RHEL_6_MAJOR_VERSION, RHEL_7_MAJOR_VERSION
from robottelo.decorators import tier1, tier3, upgrade
from robottelo.helpers import get_host_info
from robottelo.test import TestCase

PREVIOUS_INSTALLER_OPTIONS = set([
    u'--[no-]colors',
    u'--[no-]enable-certs',
    u'--[no-]enable-foreman',
    u'--[no-]enable-foreman-cli',
    u'--[no-]enable-foreman-compute-ec2',
    u'--[no-]enable-foreman-compute-gce',
    u'--[no-]enable-foreman-compute-libvirt',
    u'--[no-]enable-foreman-compute-openstack',
    u'--[no-]enable-foreman-compute-ovirt',
    u'--[no-]enable-foreman-compute-rackspace',
    u'--[no-]enable-foreman-compute-vmware',
    u'--[no-]enable-foreman-cli-kubevirt',
    u'--[no-]enable-foreman-plugin-ansible',
    u'--[no-]enable-foreman-plugin-bootdisk',
    u'--[no-]enable-foreman-plugin-discovery',
    u'--[no-]enable-foreman-plugin-hooks',
    u'--[no-]enable-foreman-plugin-kubevirt',
    u'--[no-]enable-foreman-plugin-openscap',
    u'--[no-]enable-foreman-plugin-remote-execution',
    u'--[no-]enable-foreman-plugin-tasks',
    u'--[no-]enable-foreman-plugin-templates',
    u'--[no-]enable-foreman-proxy',
    u'--[no-]enable-foreman-proxy-content',
    u'--[no-]enable-foreman-proxy-plugin-ansible',
    u'--[no-]enable-foreman-proxy-plugin-dhcp-infoblox',
    u'--[no-]enable-foreman-proxy-plugin-dhcp-remote-isc',
    u'--[no-]enable-foreman-proxy-plugin-discovery',
    u'--[no-]enable-foreman-proxy-plugin-dns-infoblox',
    u'--[no-]enable-foreman-proxy-plugin-openscap',
    u'--[no-]enable-foreman-proxy-plugin-pulp',
    u'--[no-]enable-foreman-proxy-plugin-remote-execution-ssh',
    u'--[no-]enable-katello',
    u'--[no-]enable-puppet',
    u'--[no-]lock-package-versions',
    u'--[no-]parser-cache',
    u'--certs-ca-common-name',
    u'--certs-ca-expiration',
    u'--certs-city',
    u'--certs-cname',
    u'--certs-country',
    u'--certs-default-ca-name',
    u'--certs-deploy',
    u'--certs-expiration',
    u'--certs-generate',
    u'--certs-group',
    u'--certs-log-dir',
    u'--certs-node-fqdn',
    u'--certs-org',
    u'--certs-org-unit',
    u'--certs-pki-dir',
    u'--certs-regenerate',
    u'--certs-regenerate-ca',
    u'--certs-reset',
    u'--certs-server-ca-cert',
    u'--certs-server-ca-name',
    u'--certs-server-cert',
    u'--certs-server-cert-req',
    u'--certs-server-key',
    u'--certs-skip-check',
    u'--certs-ssl-build-dir',
    u'--certs-state',
    u'--certs-tar-file',
    u'--certs-update-all',
    u'--certs-update-server',
    u'--certs-update-server-ca',
    u'--certs-user',
    u'--clear-pulp-content',
    u'--clear-puppet-environments',
    u'--color-of-background',
    u'--compare-scenarios',
    u'--disable-resolve-mismatches',
    u'--disable-scenario',
    u'--disable-system-checks',
    u'--dont-save-answers',
    u'--enable-scenario',
    u'--force',
    u'--force-upgrade-steps',
    u'--foreman-app-root',
    u'--foreman-authentication',
    u'--foreman-cli-foreman-url',
    u'--foreman-cli-hammer-plugin-prefix',
    u'--foreman-cli-manage-root-config',
    u'--foreman-cli-password',
    u'--foreman-cli-refresh-cache',
    u'--foreman-cli-request-timeout',
    u'--foreman-cli-ssl-ca-file',
    u'--foreman-cli-username',
    u'--foreman-cli-version',
    u'--foreman-client-ssl-ca',
    u'--foreman-client-ssl-cert',
    u'--foreman-client-ssl-key',
    u'--foreman-compute-ec2-version',
    u'--foreman-compute-gce-version',
    u'--foreman-compute-libvirt-version',
    u'--foreman-compute-openstack-version',
    u'--foreman-compute-ovirt-version',
    u'--foreman-compute-rackspace-version',
    u'--foreman-compute-vmware-version',
    u'--foreman-configure-epel-repo',
    u'--foreman-configure-scl-repo',
    u'--foreman-cors-domains',
    u'--foreman-db-adapter',
    u'--foreman-db-database',
    u'--foreman-db-host',
    u'--foreman-db-manage',
    u'--foreman-db-manage-rake',
    u'--foreman-db-password',
    u'--foreman-db-pool',
    u'--foreman-db-port',
    u'--foreman-db-root-cert',
    u'--foreman-db-sslmode',
    u'--foreman-db-type',
    u'--foreman-db-username',
    u'--foreman-dynflow-pool-size',
    u'--foreman-email-delivery-method',
    u'--foreman-email-smtp-address',
    u'--foreman-email-smtp-authentication',
    u'--foreman-email-smtp-domain',
    u'--foreman-email-smtp-password',
    u'--foreman-email-smtp-port',
    u'--foreman-email-smtp-user-name',
    u'--foreman-foreman-url',
    u'--foreman-gpgcheck',
    u'--foreman-group',
    u'--foreman-hsts-enabled',
    u'--foreman-http-keytab',
    u'--foreman-initial-admin-email',
    u'--foreman-initial-admin-first-name',
    u'--foreman-initial-admin-last-name',
    u'--foreman-initial-admin-password',
    u'--foreman-initial-admin-username',
    u'--foreman-initial-location',
    u'--foreman-initial-organization',
    u'--foreman-ipa-authentication',
    u'--foreman-ipa-manage-sssd',
    u'--foreman-jobs-service',
    u'--foreman-jobs-service-enable',
    u'--foreman-jobs-service-ensure',
    u'--foreman-keepalive',
    u'--foreman-keepalive-timeout',
    u'--foreman-locations-enabled',
    u'--foreman-loggers',
    u'--foreman-logging-layout',
    u'--foreman-logging-level',
    u'--foreman-logging-type',
    u'--foreman-manage-user',
    u'--foreman-max-keepalive-requests',
    u'--foreman-oauth-active',
    u'--foreman-oauth-consumer-key',
    u'--foreman-oauth-consumer-secret',
    u'--foreman-oauth-map-users',
    u'--foreman-organizations-enabled',
    u'--foreman-pam-service',
    u'--foreman-passenger',
    u'--foreman-passenger-interface',
    u'--foreman-passenger-min-instances',
    u'--foreman-passenger-prestart',
    u'--foreman-passenger-ruby',
    u'--foreman-passenger-ruby-package',
    u'--foreman-passenger-start-timeout',
    u'--foreman-plugin-prefix',
    u'--foreman-plugin-tasks-automatic-cleanup',
    u'--foreman-plugin-tasks-cron-line',
    u'--foreman-plugin-tasks-package',
    u'--foreman-plugin-version',
    u'--foreman-proxy-autosignfile',
    u'--foreman-proxy-bind-host',
    u'--foreman-proxy-bmc',
    u'--foreman-proxy-bmc-default-provider',
    u'--foreman-proxy-bmc-listen-on',
    u'--foreman-proxy-bmc-ssh-key',
    u'--foreman-proxy-bmc-ssh-powercycle',
    u'--foreman-proxy-bmc-ssh-poweroff',
    u'--foreman-proxy-bmc-ssh-poweron',
    u'--foreman-proxy-bmc-ssh-powerstatus',
    u'--foreman-proxy-bmc-ssh-user',
    u'--foreman-proxy-content-enable-deb',
    u'--foreman-proxy-content-enable-docker',
    u'--foreman-proxy-content-enable-file',
    u'--foreman-proxy-content-enable-ostree',
    u'--foreman-proxy-content-enable-puppet',
    u'--foreman-proxy-content-enable-yum',
    u'--foreman-proxy-content-manage-broker',
    u'--foreman-proxy-content-parent-fqdn',
    u'--foreman-proxy-content-pulp-admin-password',
    u'--foreman-proxy-content-pulp-ca-cert',
    u'--foreman-proxy-content-pulp-master',
    u'--foreman-proxy-content-pulp-max-speed',
    u'--foreman-proxy-content-pulp-num-workers',
    u'--foreman-proxy-content-pulp-proxy-password',
    u'--foreman-proxy-content-pulp-proxy-port',
    u'--foreman-proxy-content-pulp-proxy-url',
    u'--foreman-proxy-content-pulp-proxy-username',
    u'--foreman-proxy-content-pulp-puppet-wsgi-processes',
    u'--foreman-proxy-content-pulp-worker-timeout',
    u'--foreman-proxy-content-puppet',
    u'--foreman-proxy-content-qpid-router',
    u'--foreman-proxy-content-qpid-router-agent-addr',
    u'--foreman-proxy-content-qpid-router-agent-port',
    u'--foreman-proxy-content-qpid-router-broker-addr',
    u'--foreman-proxy-content-qpid-router-broker-port',
    u'--foreman-proxy-content-qpid-router-hub-addr',
    u'--foreman-proxy-content-qpid-router-hub-port',
    u'--foreman-proxy-content-qpid-router-logging',
    u'--foreman-proxy-content-qpid-router-logging-level',
    u'--foreman-proxy-content-qpid-router-logging-path',
    u'--foreman-proxy-content-qpid-router-sasl-mech',
    u'--foreman-proxy-content-qpid-router-sasl-password',
    u'--foreman-proxy-content-qpid-router-sasl-username',
    u'--foreman-proxy-content-qpid-router-ssl-ciphers',
    u'--foreman-proxy-content-qpid-router-ssl-protocols',
    u'--foreman-proxy-content-reverse-proxy',
    u'--foreman-proxy-content-reverse-proxy-port',
    u'--foreman-proxy-content-rhsm-hostname',
    u'--foreman-proxy-content-rhsm-url',
    u'--foreman-proxy-content-ssl-protocol',
    u'--foreman-proxy-customrun-args',
    u'--foreman-proxy-customrun-cmd',
    u'--foreman-proxy-dhcp',
    u'--foreman-proxy-dhcp-additional-interfaces',
    u'--foreman-proxy-dhcp-config',
    u'--foreman-proxy-dhcp-failover-address',
    u'--foreman-proxy-dhcp-failover-port',
    u'--foreman-proxy-dhcp-gateway',
    u'--foreman-proxy-dhcp-interface',
    u'--foreman-proxy-dhcp-key-name',
    u'--foreman-proxy-dhcp-key-secret',
    u'--foreman-proxy-dhcp-leases',
    u'--foreman-proxy-dhcp-listen-on',
    u'--foreman-proxy-dhcp-load-balance',
    u'--foreman-proxy-dhcp-load-split',
    u'--foreman-proxy-dhcp-manage-acls',
    u'--foreman-proxy-dhcp-managed',
    u'--foreman-proxy-dhcp-max-response-delay',
    u'--foreman-proxy-dhcp-max-unacked-updates',
    u'--foreman-proxy-dhcp-mclt',
    u'--foreman-proxy-dhcp-nameservers',
    u'--foreman-proxy-dhcp-netmask',
    u'--foreman-proxy-dhcp-network',
    u'--foreman-proxy-dhcp-node-type',
    u'--foreman-proxy-dhcp-omapi-port',
    u'--foreman-proxy-dhcp-option-domain',
    u'--foreman-proxy-dhcp-peer-address',
    u'--foreman-proxy-dhcp-provider',
    u'--foreman-proxy-dhcp-pxefilename',
    u'--foreman-proxy-dhcp-pxeserver',
    u'--foreman-proxy-dhcp-range',
    u'--foreman-proxy-dhcp-search-domains',
    u'--foreman-proxy-dhcp-server',
    u'--foreman-proxy-dhcp-subnets',
    u'--foreman-proxy-dir',
    u'--foreman-proxy-dns',
    u'--foreman-proxy-dns-forwarders',
    u'--foreman-proxy-dns-interface',
    u'--foreman-proxy-dns-listen-on',
    u'--foreman-proxy-dns-managed',
    u'--foreman-proxy-dns-provider',
    u'--foreman-proxy-dns-reverse',
    u'--foreman-proxy-dns-server',
    u'--foreman-proxy-dns-tsig-keytab',
    u'--foreman-proxy-dns-tsig-principal',
    u'--foreman-proxy-dns-ttl',
    u'--foreman-proxy-dns-zone',
    u'--foreman-proxy-ensure-packages-version',
    u'--foreman-proxy-foreman-base-url',
    u'--foreman-proxy-foreman-ssl-ca',
    u'--foreman-proxy-foreman-ssl-cert',
    u'--foreman-proxy-foreman-ssl-key',
    u'--foreman-proxy-freeipa-config',
    u'--foreman-proxy-freeipa-remove-dns',
    u'--foreman-proxy-gpgcheck',
    u'--foreman-proxy-groups',
    u'--foreman-proxy-http',
    u'--foreman-proxy-http-port',
    u'--foreman-proxy-httpboot',
    u'--foreman-proxy-httpboot-listen-on',
    u'--foreman-proxy-keyfile',
    u'--foreman-proxy-libvirt-connection',
    u'--foreman-proxy-libvirt-network',
    u'--foreman-proxy-log',
    u'--foreman-proxy-log-buffer',
    u'--foreman-proxy-log-buffer-errors',
    u'--foreman-proxy-log-level',
    u'--foreman-proxy-logs',
    u'--foreman-proxy-logs-listen-on',
    u'--foreman-proxy-manage-puppet-group',
    u'--foreman-proxy-manage-sudoersd',
    u'--foreman-proxy-mcollective-user',
    u'--foreman-proxy-oauth-consumer-key',
    u'--foreman-proxy-oauth-consumer-secret',
    u'--foreman-proxy-oauth-effective-user',
    u'--foreman-proxy-plugin-ansible-ansible-dir',
    u'--foreman-proxy-plugin-ansible-enabled',
    u'--foreman-proxy-plugin-ansible-host-key-checking',
    u'--foreman-proxy-plugin-ansible-listen-on',
    u'--foreman-proxy-plugin-ansible-stdout-callback',
    u'--foreman-proxy-plugin-ansible-working-dir',
    u'--foreman-proxy-plugin-dhcp-infoblox-dns-view',
    u'--foreman-proxy-plugin-dhcp-infoblox-network-view',
    u'--foreman-proxy-plugin-dhcp-infoblox-password',
    u'--foreman-proxy-plugin-dhcp-infoblox-record-type',
    u'--foreman-proxy-plugin-dhcp-infoblox-username',
    u'--foreman-proxy-plugin-dhcp-remote-isc-dhcp-config',
    u'--foreman-proxy-plugin-dhcp-remote-isc-dhcp-leases',
    u'--foreman-proxy-plugin-dhcp-remote-isc-key-name',
    u'--foreman-proxy-plugin-dhcp-remote-isc-key-secret',
    u'--foreman-proxy-plugin-dhcp-remote-isc-omapi-port',
    u'--foreman-proxy-plugin-discovery-image-name',
    u'--foreman-proxy-plugin-discovery-install-images',
    u'--foreman-proxy-plugin-discovery-source-url',
    u'--foreman-proxy-plugin-discovery-tftp-root',
    u'--foreman-proxy-plugin-dns-infoblox-dns-server',
    u'--foreman-proxy-plugin-dns-infoblox-password',
    u'--foreman-proxy-plugin-dns-infoblox-username',
    u'--foreman-proxy-plugin-dns-infoblox-dns-view',
    u'--foreman-proxy-plugin-openscap-contentdir',
    u'--foreman-proxy-plugin-openscap-enabled',
    u'--foreman-proxy-plugin-openscap-failed-dir',
    u'--foreman-proxy-plugin-openscap-listen-on',
    u'--foreman-proxy-plugin-openscap-openscap-send-log-file',
    u'--foreman-proxy-plugin-openscap-proxy-name',
    u'--foreman-proxy-plugin-openscap-reportsdir',
    u'--foreman-proxy-plugin-openscap-spooldir',
    u'--foreman-proxy-plugin-openscap-timeout',
    u'--foreman-proxy-plugin-openscap-version',
    u'--foreman-proxy-plugin-pulp-enabled',
    u'--foreman-proxy-plugin-pulp-group',
    u'--foreman-proxy-plugin-pulp-listen-on',
    u'--foreman-proxy-plugin-pulp-mongodb-dir',
    u'--foreman-proxy-plugin-pulp-pulp-content-dir',
    u'--foreman-proxy-plugin-pulp-pulp-dir',
    u'--foreman-proxy-plugin-pulp-pulp-url',
    u'--foreman-proxy-plugin-pulp-pulp3-enabled',
    u'--foreman-proxy-plugin-pulp-pulp3-mirror',
    u'--foreman-proxy-plugin-pulp-pulpnode-enabled',
    u'--foreman-proxy-plugin-pulp-puppet-content-dir',
    u'--foreman-proxy-plugin-pulp-version',
    u'--foreman-proxy-plugin-remote-execution-ssh-async-ssh',
    u'--foreman-proxy-plugin-remote-execution-ssh-enabled',
    u'--foreman-proxy-plugin-remote-execution-ssh-generate-keys',
    u'--foreman-proxy-plugin-remote-execution-ssh-install-key',
    u'--foreman-proxy-plugin-remote-execution-ssh-listen-on',
    u'--foreman-proxy-plugin-remote-execution-ssh-local-working-dir',
    u'--foreman-proxy-plugin-remote-execution-ssh-remote-working-dir',
    u'--foreman-proxy-plugin-remote-execution-ssh-ssh-identity-dir',
    u'--foreman-proxy-plugin-remote-execution-ssh-ssh-identity-file',
    u'--foreman-proxy-plugin-remote-execution-ssh-ssh-kerberos-auth',
    u'--foreman-proxy-plugin-remote-execution-ssh-ssh-keygen',
    u'--foreman-proxy-plugin-version',
    u'--foreman-proxy-puppet',
    u'--foreman-proxy-puppet-api-timeout',
    u'--foreman-proxy-puppet-group',
    u'--foreman-proxy-puppet-listen-on',
    u'--foreman-proxy-puppet-ssl-ca',
    u'--foreman-proxy-puppet-ssl-cert',
    u'--foreman-proxy-puppet-ssl-key',
    u'--foreman-proxy-puppet-url',
    u'--foreman-proxy-puppet-use-cache',
    u'--foreman-proxy-puppet-use-environment-api',
    u'--foreman-proxy-puppet-user',
    u'--foreman-proxy-puppetca',
    u'--foreman-proxy-puppetca-certificate',
    u'--foreman-proxy-puppetca-cmd',
    u'--foreman-proxy-puppetca-listen-on',
    u'--foreman-proxy-puppetca-provider',
    u'--foreman-proxy-puppetca-sign-all',
    u'--foreman-proxy-puppetca-split-configs',
    u'--foreman-proxy-puppetca-token-ttl',
    u'--foreman-proxy-puppetca-tokens-file',
    u'--foreman-proxy-puppetdir',
    u'--foreman-proxy-puppetrun-cmd',
    u'--foreman-proxy-puppetrun-provider',
    u'--foreman-proxy-puppetssh-command',
    u'--foreman-proxy-puppetssh-keyfile',
    u'--foreman-proxy-puppetssh-sudo',
    u'--foreman-proxy-puppetssh-user',
    u'--foreman-proxy-puppetssh-wait',
    u'--foreman-proxy-realm',
    u'--foreman-proxy-realm-keytab',
    u'--foreman-proxy-realm-listen-on',
    u'--foreman-proxy-realm-principal',
    u'--foreman-proxy-realm-provider',
    u'--foreman-proxy-register-in-foreman',
    u'--foreman-proxy-registered-name',
    u'--foreman-proxy-registered-proxy-url',
    u'--foreman-proxy-repo',
    u'--foreman-proxy-salt-puppetrun-cmd',
    u'--foreman-proxy-ssl',
    u'--foreman-proxy-ssl-ca',
    u'--foreman-proxy-ssl-cert',
    u'--foreman-proxy-ssl-disabled-ciphers',
    u'--foreman-proxy-ssl-key',
    u'--foreman-proxy-ssl-port',
    u'--foreman-proxy-ssldir',
    u'--foreman-proxy-template-url',
    u'--foreman-proxy-templates',
    u'--foreman-proxy-templates-listen-on',
    u'--foreman-proxy-tftp',
    u'--foreman-proxy-tftp-dirs',
    u'--foreman-proxy-tftp-listen-on',
    u'--foreman-proxy-tftp-manage-wget',
    u'--foreman-proxy-tftp-managed',
    u'--foreman-proxy-tftp-replace-grub2-cfg',
    u'--foreman-proxy-tftp-root',
    u'--foreman-proxy-tftp-servername',
    u'--foreman-proxy-tftp-syslinux-filenames',
    u'--foreman-proxy-tls-disabled-versions',
    u'--foreman-proxy-trusted-hosts',
    u'--foreman-proxy-use-sudoers',
    u'--foreman-proxy-use-sudoersd',
    u'--foreman-proxy-user',
    u'--foreman-proxy-version',
    u'--foreman-puppetrun',
    u'--foreman-rails-env',
    u'--foreman-repo',
    u'--foreman-selinux',
    u'--foreman-server-port',
    u'--foreman-server-ssl-ca',
    u'--foreman-server-ssl-cert',
    u'--foreman-server-ssl-certs-dir',
    u'--foreman-server-ssl-chain',
    u'--foreman-server-ssl-crl',
    u'--foreman-server-ssl-key',
    u'--foreman-server-ssl-port',
    u'--foreman-server-ssl-protocol',
    u'--foreman-serveraliases',
    u'--foreman-servername',
    u'--foreman-ssl',
    u'--foreman-telemetry-logger-enabled',
    u'--foreman-telemetry-logger-level',
    u'--foreman-telemetry-prefix',
    u'--foreman-telemetry-prometheus-enabled',
    u'--foreman-telemetry-statsd-enabled',
    u'--foreman-telemetry-statsd-host',
    u'--foreman-telemetry-statsd-protocol',
    u'--foreman-unattended',
    u'--foreman-unattended-url',
    u'--foreman-user',
    u'--foreman-user-groups',
    u'--foreman-version',
    u'--foreman-vhost-priority',
    u'--foreman-websockets-encrypt',
    u'--foreman-websockets-ssl-cert',
    u'--foreman-websockets-ssl-key',
    u'--full-help',
    u'--help',
    u'--ignore-undocumented',
    u'--interactive',
    u'--katello-candlepin-db-host',
    u'--katello-candlepin-db-name',
    u'--katello-candlepin-db-password',
    u'--katello-candlepin-db-port',
    u'--katello-candlepin-db-ssl',
    u'--katello-candlepin-db-ssl-verify',
    u'--katello-candlepin-db-user',
    u'--katello-candlepin-manage-db',
    u'--katello-candlepin-oauth-key',
    u'--katello-candlepin-oauth-secret',
    u'--katello-cdn-ssl-version',
    u'--katello-enable-deb',
    u'--katello-enable-docker',
    u'--katello-enable-file',
    u'--katello-enable-ostree',
    u'--katello-enable-puppet',
    u'--katello-enable-yum',
    u'--katello-group',
    u'--katello-manage-repo',
    u'--katello-num-pulp-workers',
    u'--katello-package-names',
    u'--katello-post-sync-token',
    u'--katello-proxy-password',
    u'--katello-proxy-port',
    u'--katello-proxy-url',
    u'--katello-proxy-username',
    u'--katello-pulp-db-ca-path',
    u'--katello-pulp-db-name',
    u'--katello-pulp-db-password',
    u'--katello-pulp-db-replica-set',
    u'--katello-pulp-db-seeds',
    u'--katello-pulp-db-ssl',
    u'--katello-pulp-db-ssl-certfile',
    u'--katello-pulp-db-ssl-keyfile',
    u'--katello-pulp-db-unsafe-autoretry',
    u'--katello-pulp-db-username',
    u'--katello-pulp-db-verify-ssl',
    u'--katello-pulp-db-write-concern',
    u'--katello-pulp-manage-db',
    u'--katello-pulp-max-speed',
    u'--katello-pulp-worker-timeout',
    u'--katello-qpid-hostname',
    u'--katello-qpid-interface',
    u'--katello-qpid-wcache-page-size',
    u'--katello-repo-export-dir',
    u'--katello-repo-gpgcheck',
    u'--katello-repo-gpgkey',
    u'--katello-repo-version',
    u'--katello-rest-client-timeout',
    u'--katello-user',
    u'--katello-user-groups',
    u'--list-scenarios',
    u'--log-level',
    u'--migrations-only',
    u'--noop',
    u'--profile',
    u'--puppet-additional-settings',
    u'--puppet-agent',
    u'--puppet-agent-additional-settings',
    u'--puppet-agent-noop',
    u'--puppet-agent-restart-command',
    u'--puppet-allow-any-crl-auth',
    u'--puppet-auth-allowed',
    u'--puppet-auth-template',
    u'--puppet-autosign',
    u'--puppet-autosign-content',
    u'--puppet-autosign-entries',
    u'--puppet-autosign-mode',
    u'--puppet-autosign-source',
    u'--puppet-ca-crl-filepath',
    u'--puppet-ca-port',
    u'--puppet-ca-server',
    u'--puppet-classfile',
    u'--puppet-client-certname',
    u'--puppet-client-package',
    u'--puppet-codedir',
    u'--puppet-cron-cmd',
    u'--puppet-dir',
    u'--puppet-dir-group',
    u'--puppet-dir-owner',
    u'--puppet-dns-alt-names',
    u'--puppet-environment',
    u'--puppet-group',
    u'--puppet-hiera-config',
    u'--puppet-http-connect-timeout',
    u'--puppet-http-read-timeout',
    u'--puppet-listen',
    u'--puppet-listen-to',
    u'--puppet-logdir',
    u'--puppet-manage-packages',
    u'--puppet-module-repository',
    u'--puppet-package-provider',
    u'--puppet-package-source',
    u'--puppet-pluginfactsource',
    u'--puppet-pluginsource',
    u'--puppet-pluginsync',
    u'--puppet-port',
    u'--puppet-postrun-command',
    u'--puppet-prerun-command',
    u'--puppet-puppetmaster',
    u'--puppet-remove-lock',
    u'--puppet-report',
    u'--puppet-run-hour',
    u'--puppet-run-minute',
    u'--puppet-rundir',
    u'--puppet-runinterval',
    u'--puppet-runmode',
    u'--puppet-server',
    u'--puppet-server-acceptor-threads',
    u'--puppet-server-additional-settings',
    u'--puppet-server-admin-api-whitelist',
    u'--puppet-server-allow-header-cert-info',
    u'--puppet-server-ca',
    u'--puppet-server-ca-allow-auth-extensions',
    u'--puppet-server-ca-allow-sans',
    u'--puppet-server-ca-auth-required',
    u'--puppet-server-ca-client-whitelist',
    u'--puppet-server-ca-crl-sync',
    u'--puppet-server-ca-enable-infra-crl',
    u'--puppet-server-certname',
    u'--puppet-server-check-for-updates',
    u'--puppet-server-cipher-suites',
    u'--puppet-server-common-modules-path',
    u'--puppet-server-compile-mode',
    u'--puppet-server-config-version',
    u'--puppet-server-connect-timeout',
    u'--puppet-server-crl-enable',
    u'--puppet-server-custom-trusted-oid-mapping',
    u'--puppet-server-default-manifest',
    u'--puppet-server-default-manifest-content',
    u'--puppet-server-default-manifest-path',
    u'--puppet-server-dir',
    u'--puppet-server-enc-api',
    u'--puppet-server-environment-class-cache-enabled',
    u'--puppet-server-environment-timeout',
    u'--puppet-server-environments-group',
    u'--puppet-server-environments-mode',
    u'--puppet-server-environments-owner',
    u'--puppet-server-envs-dir',
    u'--puppet-server-envs-target',
    u'--puppet-server-external-nodes',
    u'--puppet-server-foreman',
    u'--puppet-server-foreman-facts',
    u'--puppet-server-foreman-ssl-ca',
    u'--puppet-server-foreman-ssl-cert',
    u'--puppet-server-foreman-ssl-key',
    u'--puppet-server-foreman-url',
    u'--puppet-server-git-branch-map',
    u'--puppet-server-git-repo',
    u'--puppet-server-git-repo-group',
    u'--puppet-server-git-repo-mode',
    u'--puppet-server-git-repo-path',
    u'--puppet-server-git-repo-user',
    u'--puppet-server-group',
    u'--puppet-server-http',
    u'--puppet-server-http-port',
    u'--puppet-server-idle-timeout',
    u'--puppet-server-ip',
    u'--puppet-server-jruby-gem-home',
    u'--puppet-server-jvm-cli-args',
    u'--puppet-server-jvm-config',
    u'--puppet-server-jvm-extra-args',
    u'--puppet-server-jvm-java-bin',
    u'--puppet-server-jvm-max-heap-size',
    u'--puppet-server-jvm-min-heap-size',
    u'--puppet-server-manage-user',
    u'--puppet-server-max-active-instances',
    u'--puppet-server-max-open-files',
    u'--puppet-server-max-queued-requests',
    u'--puppet-server-max-requests-per-instance',
    u'--puppet-server-max-retry-delay',
    u'--puppet-server-max-threads',
    u'--puppet-server-metrics-allowed',
    u'--puppet-server-metrics-graphite-enable',
    u'--puppet-server-metrics-graphite-host',
    u'--puppet-server-metrics-graphite-interval',
    u'--puppet-server-metrics-graphite-port',
    u'--puppet-server-metrics-jmx-enable',
    u'--puppet-server-metrics-server-id',
    u'--puppet-server-package',
    u'--puppet-server-parser',
    u'--puppet-server-port',
    u'--puppet-server-post-hook-content',
    u'--puppet-server-post-hook-name',
    u'--puppet-server-puppet-basedir',
    u'--puppet-server-puppetdb-host',
    u'--puppet-server-puppetdb-port',
    u'--puppet-server-puppetdb-swf',
    u'--puppet-server-puppetserver-dir',
    u'--puppet-server-puppetserver-experimental',
    u'--puppet-server-puppetserver-jruby9k',
    u'--puppet-server-puppetserver-logdir',
    u'--puppet-server-puppetserver-metrics',
    u'--puppet-server-puppetserver-rundir',
    u'--puppet-server-puppetserver-trusted-agents',
    u'--puppet-server-puppetserver-vardir',
    u'--puppet-server-puppetserver-version',
    u'--puppet-server-report-api',
    u'--puppet-server-reports',
    u'--puppet-server-request-timeout',
    u'--puppet-server-ruby-load-paths',
    u'--puppet-server-selector-threads',
    u'--puppet-server-ssl-acceptor-threads',
    u'--puppet-server-ssl-chain-filepath',
    u'--puppet-server-ssl-dir',
    u'--puppet-server-ssl-dir-manage',
    u'--puppet-server-ssl-key-manage',
    u'--puppet-server-ssl-protocols',
    u'--puppet-server-ssl-selector-threads',
    u'--puppet-server-storeconfigs-backend',
    u'--puppet-server-strict-variables',
    u'--puppet-server-use-legacy-auth-conf',
    u'--puppet-server-user',
    u'--puppet-server-version',
    u'--puppet-server-web-idle-timeout',
    u'--puppet-service-name',
    u'--puppet-sharedir',
    u'--puppet-show-diff',
    u'--puppet-splay',
    u'--puppet-splaylimit',
    u'--puppet-srv-domain',
    u'--puppet-ssldir',
    u'--puppet-syslogfacility',
    u'--puppet-systemd-cmd',
    u'--puppet-systemd-randomizeddelaysec',
    u'--puppet-systemd-unit-name',
    u'--puppet-unavailable-runmodes',
    u'--puppet-use-srv-records',
    u'--puppet-usecacheonfailure',
    u'--puppet-user',
    u'--puppet-vardir',
    u'--puppet-version',
    u'--reset',
    u'--reset-certs-ca-common-name',
    u'--reset-certs-ca-expiration',
    u'--reset-certs-city',
    u'--reset-certs-cname',
    u'--reset-certs-country',
    u'--reset-certs-default-ca-name',
    u'--reset-certs-deploy',
    u'--reset-certs-expiration',
    u'--reset-certs-generate',
    u'--reset-certs-group',
    u'--reset-certs-log-dir',
    u'--reset-certs-node-fqdn',
    u'--reset-certs-org',
    u'--reset-certs-org-unit',
    u'--reset-certs-pki-dir',
    u'--reset-certs-regenerate',
    u'--reset-certs-regenerate-ca',
    u'--reset-certs-server-ca-cert',
    u'--reset-certs-server-ca-name',
    u'--reset-certs-server-cert',
    u'--reset-certs-server-cert-req',
    u'--reset-certs-server-key',
    u'--reset-certs-ssl-build-dir',
    u'--reset-certs-state',
    u'--reset-certs-tar-file',
    u'--reset-certs-user',
    u'--reset-foreman-app-root',
    u'--reset-foreman-authentication',
    u'--reset-foreman-cli-foreman-url',
    u'--reset-foreman-cli-hammer-plugin-prefix',
    u'--reset-foreman-cli-manage-root-config',
    u'--reset-foreman-cli-password',
    u'--reset-foreman-cli-refresh-cache',
    u'--reset-foreman-cli-request-timeout',
    u'--reset-foreman-cli-ssl-ca-file',
    u'--reset-foreman-cli-username',
    u'--reset-foreman-cli-version',
    u'--reset-foreman-client-ssl-ca',
    u'--reset-foreman-client-ssl-cert',
    u'--reset-foreman-client-ssl-key',
    u'--reset-foreman-compute-ec2-version',
    u'--reset-foreman-compute-gce-version',
    u'--reset-foreman-compute-libvirt-version',
    u'--reset-foreman-compute-openstack-version',
    u'--reset-foreman-compute-ovirt-version',
    u'--reset-foreman-compute-rackspace-version',
    u'--reset-foreman-compute-vmware-version',
    u'--reset-foreman-configure-epel-repo',
    u'--reset-foreman-configure-scl-repo',
    u'--reset-foreman-cors-domains',
    u'--reset-foreman-db-adapter',
    u'--reset-foreman-db-database',
    u'--reset-foreman-db-host',
    u'--reset-foreman-db-manage',
    u'--reset-foreman-db-manage-rake',
    u'--reset-foreman-db-password',
    u'--reset-foreman-db-pool',
    u'--reset-foreman-db-port',
    u'--reset-foreman-db-root-cert',
    u'--reset-foreman-db-sslmode',
    u'--reset-foreman-db-type',
    u'--reset-foreman-db-username',
    u'--reset-foreman-dynflow-pool-size',
    u'--reset-foreman-email-delivery-method',
    u'--reset-foreman-email-smtp-address',
    u'--reset-foreman-email-smtp-authentication',
    u'--reset-foreman-email-smtp-domain',
    u'--reset-foreman-email-smtp-password',
    u'--reset-foreman-email-smtp-port',
    u'--reset-foreman-email-smtp-user-name',
    u'--reset-foreman-foreman-url',
    u'--reset-foreman-gpgcheck',
    u'--reset-foreman-group',
    u'--reset-foreman-hsts-enabled',
    u'--reset-foreman-http-keytab',
    u'--reset-foreman-initial-admin-email',
    u'--reset-foreman-initial-admin-first-name',
    u'--reset-foreman-initial-admin-last-name',
    u'--reset-foreman-initial-admin-password',
    u'--reset-foreman-initial-admin-username',
    u'--reset-foreman-initial-location',
    u'--reset-foreman-initial-organization',
    u'--reset-foreman-ipa-authentication',
    u'--reset-foreman-ipa-manage-sssd',
    u'--reset-foreman-jobs-service',
    u'--reset-foreman-jobs-service-enable',
    u'--reset-foreman-jobs-service-ensure',
    u'--reset-foreman-keepalive',
    u'--reset-foreman-keepalive-timeout',
    u'--reset-foreman-locations-enabled',
    u'--reset-foreman-loggers',
    u'--reset-foreman-logging-layout',
    u'--reset-foreman-logging-level',
    u'--reset-foreman-logging-type',
    u'--reset-foreman-manage-user',
    u'--reset-foreman-max-keepalive-requests',
    u'--reset-foreman-oauth-active',
    u'--reset-foreman-oauth-consumer-key',
    u'--reset-foreman-oauth-consumer-secret',
    u'--reset-foreman-oauth-map-users',
    u'--reset-foreman-organizations-enabled',
    u'--reset-foreman-pam-service',
    u'--reset-foreman-passenger',
    u'--reset-foreman-passenger-interface',
    u'--reset-foreman-passenger-min-instances',
    u'--reset-foreman-passenger-prestart',
    u'--reset-foreman-passenger-ruby',
    u'--reset-foreman-passenger-ruby-package',
    u'--reset-foreman-passenger-start-timeout',
    u'--reset-foreman-plugin-prefix',
    u'--reset-foreman-plugin-tasks-automatic-cleanup',
    u'--reset-foreman-plugin-tasks-cron-line',
    u'--reset-foreman-plugin-tasks-package',
    u'--reset-foreman-plugin-version',
    u'--reset-foreman-proxy-autosignfile',
    u'--reset-foreman-proxy-bind-host',
    u'--reset-foreman-proxy-bmc',
    u'--reset-foreman-proxy-bmc-default-provider',
    u'--reset-foreman-proxy-bmc-listen-on',
    u'--reset-foreman-proxy-bmc-ssh-key',
    u'--reset-foreman-proxy-bmc-ssh-powercycle',
    u'--reset-foreman-proxy-bmc-ssh-poweroff',
    u'--reset-foreman-proxy-bmc-ssh-poweron',
    u'--reset-foreman-proxy-bmc-ssh-powerstatus',
    u'--reset-foreman-proxy-bmc-ssh-user',
    u'--reset-foreman-proxy-content-enable-deb',
    u'--reset-foreman-proxy-content-enable-docker',
    u'--reset-foreman-proxy-content-enable-file',
    u'--reset-foreman-proxy-content-enable-ostree',
    u'--reset-foreman-proxy-content-enable-puppet',
    u'--reset-foreman-proxy-content-enable-yum',
    u'--reset-foreman-proxy-content-manage-broker',
    u'--reset-foreman-proxy-content-parent-fqdn',
    u'--reset-foreman-proxy-content-pulp-admin-password',
    u'--reset-foreman-proxy-content-pulp-ca-cert',
    u'--reset-foreman-proxy-content-pulp-master',
    u'--reset-foreman-proxy-content-pulp-max-speed',
    u'--reset-foreman-proxy-content-pulp-num-workers',
    u'--reset-foreman-proxy-content-pulp-proxy-password',
    u'--reset-foreman-proxy-content-pulp-proxy-port',
    u'--reset-foreman-proxy-content-pulp-proxy-url',
    u'--reset-foreman-proxy-content-pulp-proxy-username',
    u'--reset-foreman-proxy-content-pulp-puppet-wsgi-processes',
    u'--reset-foreman-proxy-content-pulp-worker-timeout',
    u'--reset-foreman-proxy-content-puppet',
    u'--reset-foreman-proxy-content-qpid-router',
    u'--reset-foreman-proxy-content-qpid-router-agent-addr',
    u'--reset-foreman-proxy-content-qpid-router-agent-port',
    u'--reset-foreman-proxy-content-qpid-router-broker-addr',
    u'--reset-foreman-proxy-content-qpid-router-broker-port',
    u'--reset-foreman-proxy-content-qpid-router-hub-addr',
    u'--reset-foreman-proxy-content-qpid-router-hub-port',
    u'--reset-foreman-proxy-content-qpid-router-logging',
    u'--reset-foreman-proxy-content-qpid-router-logging-level',
    u'--reset-foreman-proxy-content-qpid-router-logging-path',
    u'--reset-foreman-proxy-content-qpid-router-sasl-mech',
    u'--reset-foreman-proxy-content-qpid-router-sasl-password',
    u'--reset-foreman-proxy-content-qpid-router-sasl-username',
    u'--reset-foreman-proxy-content-qpid-router-ssl-ciphers',
    u'--reset-foreman-proxy-content-qpid-router-ssl-protocols',
    u'--reset-foreman-proxy-content-reverse-proxy',
    u'--reset-foreman-proxy-content-reverse-proxy-port',
    u'--reset-foreman-proxy-content-rhsm-hostname',
    u'--reset-foreman-proxy-content-rhsm-url',
    u'--reset-foreman-proxy-content-ssl-protocol',
    u'--reset-foreman-proxy-customrun-args',
    u'--reset-foreman-proxy-customrun-cmd',
    u'--reset-foreman-proxy-dhcp',
    u'--reset-foreman-proxy-dhcp-additional-interfaces',
    u'--reset-foreman-proxy-dhcp-config',
    u'--reset-foreman-proxy-dhcp-failover-address',
    u'--reset-foreman-proxy-dhcp-failover-port',
    u'--reset-foreman-proxy-dhcp-gateway',
    u'--reset-foreman-proxy-dhcp-interface',
    u'--reset-foreman-proxy-dhcp-key-name',
    u'--reset-foreman-proxy-dhcp-key-secret',
    u'--reset-foreman-proxy-dhcp-leases',
    u'--reset-foreman-proxy-dhcp-listen-on',
    u'--reset-foreman-proxy-dhcp-load-balance',
    u'--reset-foreman-proxy-dhcp-load-split',
    u'--reset-foreman-proxy-dhcp-manage-acls',
    u'--reset-foreman-proxy-dhcp-managed',
    u'--reset-foreman-proxy-dhcp-max-response-delay',
    u'--reset-foreman-proxy-dhcp-max-unacked-updates',
    u'--reset-foreman-proxy-dhcp-mclt',
    u'--reset-foreman-proxy-dhcp-nameservers',
    u'--reset-foreman-proxy-dhcp-netmask',
    u'--reset-foreman-proxy-dhcp-network',
    u'--reset-foreman-proxy-dhcp-node-type',
    u'--reset-foreman-proxy-dhcp-omapi-port',
    u'--reset-foreman-proxy-dhcp-option-domain',
    u'--reset-foreman-proxy-dhcp-peer-address',
    u'--reset-foreman-proxy-dhcp-provider',
    u'--reset-foreman-proxy-dhcp-pxefilename',
    u'--reset-foreman-proxy-dhcp-pxeserver',
    u'--reset-foreman-proxy-dhcp-range',
    u'--reset-foreman-proxy-dhcp-search-domains',
    u'--reset-foreman-proxy-dhcp-server',
    u'--reset-foreman-proxy-dhcp-subnets',
    u'--reset-foreman-proxy-dir',
    u'--reset-foreman-proxy-dns',
    u'--reset-foreman-proxy-dns-forwarders',
    u'--reset-foreman-proxy-dns-interface',
    u'--reset-foreman-proxy-dns-listen-on',
    u'--reset-foreman-proxy-dns-managed',
    u'--reset-foreman-proxy-dns-provider',
    u'--reset-foreman-proxy-dns-reverse',
    u'--reset-foreman-proxy-dns-server',
    u'--reset-foreman-proxy-dns-tsig-keytab',
    u'--reset-foreman-proxy-dns-tsig-principal',
    u'--reset-foreman-proxy-dns-ttl',
    u'--reset-foreman-proxy-dns-zone',
    u'--reset-foreman-proxy-ensure-packages-version',
    u'--reset-foreman-proxy-foreman-base-url',
    u'--reset-foreman-proxy-foreman-ssl-ca',
    u'--reset-foreman-proxy-foreman-ssl-cert',
    u'--reset-foreman-proxy-foreman-ssl-key',
    u'--reset-foreman-proxy-freeipa-config',
    u'--reset-foreman-proxy-freeipa-remove-dns',
    u'--reset-foreman-proxy-gpgcheck',
    u'--reset-foreman-proxy-groups',
    u'--reset-foreman-proxy-http',
    u'--reset-foreman-proxy-http-port',
    u'--reset-foreman-proxy-httpboot',
    u'--reset-foreman-proxy-httpboot-listen-on',
    u'--reset-foreman-proxy-keyfile',
    u'--reset-foreman-proxy-libvirt-connection',
    u'--reset-foreman-proxy-libvirt-network',
    u'--reset-foreman-proxy-log',
    u'--reset-foreman-proxy-log-buffer',
    u'--reset-foreman-proxy-log-buffer-errors',
    u'--reset-foreman-proxy-log-level',
    u'--reset-foreman-proxy-logs',
    u'--reset-foreman-proxy-logs-listen-on',
    u'--reset-foreman-proxy-manage-puppet-group',
    u'--reset-foreman-proxy-manage-sudoersd',
    u'--reset-foreman-proxy-mcollective-user',
    u'--reset-foreman-proxy-oauth-consumer-key',
    u'--reset-foreman-proxy-oauth-consumer-secret',
    u'--reset-foreman-proxy-oauth-effective-user',
    u'--reset-foreman-proxy-plugin-ansible-ansible-dir',
    u'--reset-foreman-proxy-plugin-ansible-enabled',
    u'--reset-foreman-proxy-plugin-ansible-host-key-checking',
    u'--reset-foreman-proxy-plugin-ansible-listen-on',
    u'--reset-foreman-proxy-plugin-ansible-stdout-callback',
    u'--reset-foreman-proxy-plugin-ansible-working-dir',
    u'--reset-foreman-proxy-plugin-dhcp-infoblox-dns-view',
    u'--reset-foreman-proxy-plugin-dhcp-infoblox-network-view',
    u'--reset-foreman-proxy-plugin-dhcp-infoblox-password',
    u'--reset-foreman-proxy-plugin-dhcp-infoblox-record-type',
    u'--reset-foreman-proxy-plugin-dhcp-infoblox-username',
    u'--reset-foreman-proxy-plugin-dhcp-remote-isc-dhcp-config',
    u'--reset-foreman-proxy-plugin-dhcp-remote-isc-dhcp-leases',
    u'--reset-foreman-proxy-plugin-dhcp-remote-isc-key-name',
    u'--reset-foreman-proxy-plugin-dhcp-remote-isc-key-secret',
    u'--reset-foreman-proxy-plugin-dhcp-remote-isc-omapi-port',
    u'--reset-foreman-proxy-plugin-discovery-image-name',
    u'--reset-foreman-proxy-plugin-discovery-install-images',
    u'--reset-foreman-proxy-plugin-discovery-source-url',
    u'--reset-foreman-proxy-plugin-discovery-tftp-root',
    u'--reset-foreman-proxy-plugin-dns-infoblox-dns-server',
    u'--reset-foreman-proxy-plugin-dns-infoblox-password',
    u'--reset-foreman-proxy-plugin-dns-infoblox-username',
    u'--reset-foreman-proxy-plugin-dns-infoblox-dns-view',
    u'--reset-foreman-proxy-plugin-openscap-contentdir',
    u'--reset-foreman-proxy-plugin-openscap-enabled',
    u'--reset-foreman-proxy-plugin-openscap-failed-dir',
    u'--reset-foreman-proxy-plugin-openscap-listen-on',
    u'--reset-foreman-proxy-plugin-openscap-openscap-send-log-file',
    u'--reset-foreman-proxy-plugin-openscap-proxy-name',
    u'--reset-foreman-proxy-plugin-openscap-reportsdir',
    u'--reset-foreman-proxy-plugin-openscap-spooldir',
    u'--reset-foreman-proxy-plugin-openscap-timeout',
    u'--reset-foreman-proxy-plugin-openscap-version',
    u'--reset-foreman-proxy-plugin-pulp-enabled',
    u'--reset-foreman-proxy-plugin-pulp-group',
    u'--reset-foreman-proxy-plugin-pulp-listen-on',
    u'--reset-foreman-proxy-plugin-pulp-mongodb-dir',
    u'--reset-foreman-proxy-plugin-pulp-pulp-content-dir',
    u'--reset-foreman-proxy-plugin-pulp-pulp-dir',
    u'--reset-foreman-proxy-plugin-pulp-pulp-url',
    u'--reset-foreman-proxy-plugin-pulp-pulp3-enabled',
    u'--reset-foreman-proxy-plugin-pulp-pulp3-mirror',
    u'--reset-foreman-proxy-plugin-pulp-pulpnode-enabled',
    u'--reset-foreman-proxy-plugin-pulp-puppet-content-dir',
    u'--reset-foreman-proxy-plugin-pulp-version',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-async-ssh',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-enabled',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-generate-keys',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-install-key',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-listen-on',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-local-working-dir',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-remote-working-dir',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-ssh-identity-dir',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-ssh-identity-file',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-ssh-kerberos-auth',
    u'--reset-foreman-proxy-plugin-remote-execution-ssh-ssh-keygen',
    u'--reset-foreman-proxy-plugin-version',
    u'--reset-foreman-proxy-puppet',
    u'--reset-foreman-proxy-puppet-api-timeout',
    u'--reset-foreman-proxy-puppet-group',
    u'--reset-foreman-proxy-puppet-listen-on',
    u'--reset-foreman-proxy-puppet-ssl-ca',
    u'--reset-foreman-proxy-puppet-ssl-cert',
    u'--reset-foreman-proxy-puppet-ssl-key',
    u'--reset-foreman-proxy-puppet-url',
    u'--reset-foreman-proxy-puppet-use-cache',
    u'--reset-foreman-proxy-puppet-use-environment-api',
    u'--reset-foreman-proxy-puppet-user',
    u'--reset-foreman-proxy-puppetca',
    u'--reset-foreman-proxy-puppetca-certificate',
    u'--reset-foreman-proxy-puppetca-cmd',
    u'--reset-foreman-proxy-puppetca-listen-on',
    u'--reset-foreman-proxy-puppetca-provider',
    u'--reset-foreman-proxy-puppetca-sign-all',
    u'--reset-foreman-proxy-puppetca-split-configs',
    u'--reset-foreman-proxy-puppetca-token-ttl',
    u'--reset-foreman-proxy-puppetca-tokens-file',
    u'--reset-foreman-proxy-puppetdir',
    u'--reset-foreman-proxy-puppetrun-cmd',
    u'--reset-foreman-proxy-puppetrun-provider',
    u'--reset-foreman-proxy-puppetssh-command',
    u'--reset-foreman-proxy-puppetssh-keyfile',
    u'--reset-foreman-proxy-puppetssh-sudo',
    u'--reset-foreman-proxy-puppetssh-user',
    u'--reset-foreman-proxy-puppetssh-wait',
    u'--reset-foreman-proxy-realm',
    u'--reset-foreman-proxy-realm-keytab',
    u'--reset-foreman-proxy-realm-listen-on',
    u'--reset-foreman-proxy-realm-principal',
    u'--reset-foreman-proxy-realm-provider',
    u'--reset-foreman-proxy-register-in-foreman',
    u'--reset-foreman-proxy-registered-name',
    u'--reset-foreman-proxy-registered-proxy-url',
    u'--reset-foreman-proxy-repo',
    u'--reset-foreman-proxy-salt-puppetrun-cmd',
    u'--reset-foreman-proxy-ssl',
    u'--reset-foreman-proxy-ssl-ca',
    u'--reset-foreman-proxy-ssl-cert',
    u'--reset-foreman-proxy-ssl-disabled-ciphers',
    u'--reset-foreman-proxy-ssl-key',
    u'--reset-foreman-proxy-ssl-port',
    u'--reset-foreman-proxy-ssldir',
    u'--reset-foreman-proxy-template-url',
    u'--reset-foreman-proxy-templates',
    u'--reset-foreman-proxy-templates-listen-on',
    u'--reset-foreman-proxy-tftp',
    u'--reset-foreman-proxy-tftp-dirs',
    u'--reset-foreman-proxy-tftp-listen-on',
    u'--reset-foreman-proxy-tftp-manage-wget',
    u'--reset-foreman-proxy-tftp-managed',
    u'--reset-foreman-proxy-tftp-replace-grub2-cfg',
    u'--reset-foreman-proxy-tftp-root',
    u'--reset-foreman-proxy-tftp-servername',
    u'--reset-foreman-proxy-tftp-syslinux-filenames',
    u'--reset-foreman-proxy-tls-disabled-versions',
    u'--reset-foreman-proxy-trusted-hosts',
    u'--reset-foreman-proxy-use-sudoers',
    u'--reset-foreman-proxy-use-sudoersd',
    u'--reset-foreman-proxy-user',
    u'--reset-foreman-proxy-version',
    u'--reset-foreman-puppetrun',
    u'--reset-foreman-rails-env',
    u'--reset-foreman-repo',
    u'--reset-foreman-selinux',
    u'--reset-foreman-server-port',
    u'--reset-foreman-server-ssl-ca',
    u'--reset-foreman-server-ssl-cert',
    u'--reset-foreman-server-ssl-certs-dir',
    u'--reset-foreman-server-ssl-chain',
    u'--reset-foreman-server-ssl-crl',
    u'--reset-foreman-server-ssl-key',
    u'--reset-foreman-server-ssl-port',
    u'--reset-foreman-server-ssl-protocol',
    u'--reset-foreman-serveraliases',
    u'--reset-foreman-servername',
    u'--reset-foreman-ssl',
    u'--reset-foreman-telemetry-logger-enabled',
    u'--reset-foreman-telemetry-logger-level',
    u'--reset-foreman-telemetry-prefix',
    u'--reset-foreman-telemetry-prometheus-enabled',
    u'--reset-foreman-telemetry-statsd-enabled',
    u'--reset-foreman-telemetry-statsd-host',
    u'--reset-foreman-telemetry-statsd-protocol',
    u'--reset-foreman-unattended',
    u'--reset-foreman-unattended-url',
    u'--reset-foreman-user',
    u'--reset-foreman-user-groups',
    u'--reset-foreman-version',
    u'--reset-foreman-vhost-priority',
    u'--reset-foreman-websockets-encrypt',
    u'--reset-foreman-websockets-ssl-cert',
    u'--reset-foreman-websockets-ssl-key',
    u'--reset-katello-candlepin-db-host',
    u'--reset-katello-candlepin-db-name',
    u'--reset-katello-candlepin-db-password',
    u'--reset-katello-candlepin-db-port',
    u'--reset-katello-candlepin-db-ssl',
    u'--reset-katello-candlepin-db-ssl-verify',
    u'--reset-katello-candlepin-db-user',
    u'--reset-katello-candlepin-manage-db',
    u'--reset-katello-candlepin-oauth-key',
    u'--reset-katello-candlepin-oauth-secret',
    u'--reset-katello-cdn-ssl-version',
    u'--reset-katello-enable-deb',
    u'--reset-katello-enable-docker',
    u'--reset-katello-enable-file',
    u'--reset-katello-enable-ostree',
    u'--reset-katello-enable-puppet',
    u'--reset-katello-enable-yum',
    u'--reset-katello-group',
    u'--reset-katello-manage-repo',
    u'--reset-katello-num-pulp-workers',
    u'--reset-katello-package-names',
    u'--reset-katello-post-sync-token',
    u'--reset-katello-proxy-password',
    u'--reset-katello-proxy-port',
    u'--reset-katello-proxy-url',
    u'--reset-katello-proxy-username',
    u'--reset-katello-pulp-db-ca-path',
    u'--reset-katello-pulp-db-name',
    u'--reset-katello-pulp-db-password',
    u'--reset-katello-pulp-db-replica-set',
    u'--reset-katello-pulp-db-seeds',
    u'--reset-katello-pulp-db-ssl',
    u'--reset-katello-pulp-db-ssl-certfile',
    u'--reset-katello-pulp-db-ssl-keyfile',
    u'--reset-katello-pulp-db-unsafe-autoretry',
    u'--reset-katello-pulp-db-username',
    u'--reset-katello-pulp-db-verify-ssl',
    u'--reset-katello-pulp-db-write-concern',
    u'--reset-katello-pulp-manage-db',
    u'--reset-katello-pulp-max-speed',
    u'--reset-katello-pulp-worker-timeout',
    u'--reset-katello-qpid-hostname',
    u'--reset-katello-qpid-interface',
    u'--reset-katello-qpid-wcache-page-size',
    u'--reset-katello-repo-export-dir',
    u'--reset-katello-repo-gpgcheck',
    u'--reset-katello-repo-gpgkey',
    u'--reset-katello-repo-version',
    u'--reset-katello-rest-client-timeout',
    u'--reset-katello-user',
    u'--reset-katello-user-groups',
    u'--reset-puppet-additional-settings',
    u'--reset-puppet-agent',
    u'--reset-puppet-agent-additional-settings',
    u'--reset-puppet-agent-noop',
    u'--reset-puppet-agent-restart-command',
    u'--reset-puppet-allow-any-crl-auth',
    u'--reset-puppet-auth-allowed',
    u'--reset-puppet-auth-template',
    u'--reset-puppet-autosign',
    u'--reset-puppet-autosign-content',
    u'--reset-puppet-autosign-entries',
    u'--reset-puppet-autosign-mode',
    u'--reset-puppet-autosign-source',
    u'--reset-puppet-ca-crl-filepath',
    u'--reset-puppet-ca-port',
    u'--reset-puppet-ca-server',
    u'--reset-puppet-classfile',
    u'--reset-puppet-client-certname',
    u'--reset-puppet-client-package',
    u'--reset-puppet-codedir',
    u'--reset-puppet-cron-cmd',
    u'--reset-puppet-dir',
    u'--reset-puppet-dir-group',
    u'--reset-puppet-dir-owner',
    u'--reset-puppet-dns-alt-names',
    u'--reset-puppet-environment',
    u'--reset-puppet-group',
    u'--reset-puppet-hiera-config',
    u'--reset-puppet-http-connect-timeout',
    u'--reset-puppet-http-read-timeout',
    u'--reset-puppet-listen',
    u'--reset-puppet-listen-to',
    u'--reset-puppet-logdir',
    u'--reset-puppet-manage-packages',
    u'--reset-puppet-module-repository',
    u'--reset-puppet-package-provider',
    u'--reset-puppet-package-source',
    u'--reset-puppet-pluginfactsource',
    u'--reset-puppet-pluginsource',
    u'--reset-puppet-pluginsync',
    u'--reset-puppet-port',
    u'--reset-puppet-postrun-command',
    u'--reset-puppet-prerun-command',
    u'--reset-puppet-puppetmaster',
    u'--reset-puppet-remove-lock',
    u'--reset-puppet-report',
    u'--reset-puppet-run-hour',
    u'--reset-puppet-run-minute',
    u'--reset-puppet-rundir',
    u'--reset-puppet-runinterval',
    u'--reset-puppet-runmode',
    u'--reset-puppet-server',
    u'--reset-puppet-server-acceptor-threads',
    u'--reset-puppet-server-additional-settings',
    u'--reset-puppet-server-admin-api-whitelist',
    u'--reset-puppet-server-allow-header-cert-info',
    u'--reset-puppet-server-ca',
    u'--reset-puppet-server-ca-allow-auth-extensions',
    u'--reset-puppet-server-ca-allow-sans',
    u'--reset-puppet-server-ca-auth-required',
    u'--reset-puppet-server-ca-client-whitelist',
    u'--reset-puppet-server-ca-crl-sync',
    u'--reset-puppet-server-ca-enable-infra-crl',
    u'--reset-puppet-server-certname',
    u'--reset-puppet-server-check-for-updates',
    u'--reset-puppet-server-cipher-suites',
    u'--reset-puppet-server-common-modules-path',
    u'--reset-puppet-server-compile-mode',
    u'--reset-puppet-server-config-version',
    u'--reset-puppet-server-connect-timeout',
    u'--reset-puppet-server-crl-enable',
    u'--reset-puppet-server-custom-trusted-oid-mapping',
    u'--reset-puppet-server-default-manifest',
    u'--reset-puppet-server-default-manifest-content',
    u'--reset-puppet-server-default-manifest-path',
    u'--reset-puppet-server-dir',
    u'--reset-puppet-server-enc-api',
    u'--reset-puppet-server-environment-class-cache-enabled',
    u'--reset-puppet-server-environment-timeout',
    u'--reset-puppet-server-environments-group',
    u'--reset-puppet-server-environments-mode',
    u'--reset-puppet-server-environments-owner',
    u'--reset-puppet-server-envs-dir',
    u'--reset-puppet-server-envs-target',
    u'--reset-puppet-server-external-nodes',
    u'--reset-puppet-server-foreman',
    u'--reset-puppet-server-foreman-facts',
    u'--reset-puppet-server-foreman-ssl-ca',
    u'--reset-puppet-server-foreman-ssl-cert',
    u'--reset-puppet-server-foreman-ssl-key',
    u'--reset-puppet-server-foreman-url',
    u'--reset-puppet-server-git-branch-map',
    u'--reset-puppet-server-git-repo',
    u'--reset-puppet-server-git-repo-group',
    u'--reset-puppet-server-git-repo-mode',
    u'--reset-puppet-server-git-repo-path',
    u'--reset-puppet-server-git-repo-user',
    u'--reset-puppet-server-group',
    u'--reset-puppet-server-http',
    u'--reset-puppet-server-http-port',
    u'--reset-puppet-server-idle-timeout',
    u'--reset-puppet-server-ip',
    u'--reset-puppet-server-jruby-gem-home',
    u'--reset-puppet-server-jvm-cli-args',
    u'--reset-puppet-server-jvm-config',
    u'--reset-puppet-server-jvm-extra-args',
    u'--reset-puppet-server-jvm-java-bin',
    u'--reset-puppet-server-jvm-max-heap-size',
    u'--reset-puppet-server-jvm-min-heap-size',
    u'--reset-puppet-server-manage-user',
    u'--reset-puppet-server-max-active-instances',
    u'--reset-puppet-server-max-open-files',
    u'--reset-puppet-server-max-queued-requests',
    u'--reset-puppet-server-max-requests-per-instance',
    u'--reset-puppet-server-max-retry-delay',
    u'--reset-puppet-server-max-threads',
    u'--reset-puppet-server-metrics-allowed',
    u'--reset-puppet-server-metrics-graphite-enable',
    u'--reset-puppet-server-metrics-graphite-host',
    u'--reset-puppet-server-metrics-graphite-interval',
    u'--reset-puppet-server-metrics-graphite-port',
    u'--reset-puppet-server-metrics-jmx-enable',
    u'--reset-puppet-server-metrics-server-id',
    u'--reset-puppet-server-package',
    u'--reset-puppet-server-parser',
    u'--reset-puppet-server-port',
    u'--reset-puppet-server-post-hook-content',
    u'--reset-puppet-server-post-hook-name',
    u'--reset-puppet-server-puppet-basedir',
    u'--reset-puppet-server-puppetdb-host',
    u'--reset-puppet-server-puppetdb-port',
    u'--reset-puppet-server-puppetdb-swf',
    u'--reset-puppet-server-puppetserver-dir',
    u'--reset-puppet-server-puppetserver-experimental',
    u'--reset-puppet-server-puppetserver-jruby9k',
    u'--reset-puppet-server-puppetserver-logdir',
    u'--reset-puppet-server-puppetserver-metrics',
    u'--reset-puppet-server-puppetserver-rundir',
    u'--reset-puppet-server-puppetserver-trusted-agents',
    u'--reset-puppet-server-puppetserver-vardir',
    u'--reset-puppet-server-puppetserver-version',
    u'--reset-puppet-server-report-api',
    u'--reset-puppet-server-reports',
    u'--reset-puppet-server-request-timeout',
    u'--reset-puppet-server-ruby-load-paths',
    u'--reset-puppet-server-selector-threads',
    u'--reset-puppet-server-ssl-acceptor-threads',
    u'--reset-puppet-server-ssl-chain-filepath',
    u'--reset-puppet-server-ssl-dir',
    u'--reset-puppet-server-ssl-dir-manage',
    u'--reset-puppet-server-ssl-key-manage',
    u'--reset-puppet-server-ssl-protocols',
    u'--reset-puppet-server-ssl-selector-threads',
    u'--reset-puppet-server-storeconfigs-backend',
    u'--reset-puppet-server-strict-variables',
    u'--reset-puppet-server-use-legacy-auth-conf',
    u'--reset-puppet-server-user',
    u'--reset-puppet-server-version',
    u'--reset-puppet-server-web-idle-timeout',
    u'--reset-puppet-service-name',
    u'--reset-puppet-sharedir',
    u'--reset-puppet-show-diff',
    u'--reset-puppet-splay',
    u'--reset-puppet-splaylimit',
    u'--reset-puppet-srv-domain',
    u'--reset-puppet-ssldir',
    u'--reset-puppet-syslogfacility',
    u'--reset-puppet-systemd-cmd',
    u'--reset-puppet-systemd-randomizeddelaysec',
    u'--reset-puppet-systemd-unit-name',
    u'--reset-puppet-unavailable-runmodes',
    u'--reset-puppet-use-srv-records',
    u'--reset-puppet-usecacheonfailure',
    u'--reset-puppet-user',
    u'--reset-puppet-vardir',
    u'--reset-puppet-version',
    u'--scenario',
    u'--skip-checks-i-know-better',
    u'--skip-puppet-version-check',
    u'--upgrade',
    u'--upgrade-mongo-storage-engine',
    u'--verbose',
    u'--verbose-log-level',
    u'-S',
    u'-h',
    u'-i',
    u'-l',
    u'-n',
    u'-p',
    u'-s',
    u'-v',
])


class SELinuxTestCase(TestCase):
    """Checks SELinux installation status"""

    version_regex = re.compile(r'((\d\.?)+[-.]\d)')

    @upgrade
    @tier1
    def test_positive_foreman_module(self):
        """Check if SELinux foreman module has the right version

        :id: a0736b3a-3d42-4a09-a11a-28c1d58214a5

        :expectedresults: Foreman RPM and SELinux module versions match
        """
        rpm_result = ssh.command('rpm -q foreman-selinux')
        self.assertEqual(rpm_result.return_code, 0)
        semodule_result = ssh.command('semodule -l | grep foreman')
        self.assertEqual(semodule_result.return_code, 0)

        # Sample rpm output: foreman-selinux-1.7.2.8-1.el7sat.noarch
        rpm_version = self.version_regex.search(
            ''.join(rpm_result.stdout)).group(1)
        # Sample semodule output: foreman        1.7.2.8
        semodule_version = self.version_regex.search(
            ''.join(semodule_result.stdout)).group(1)

        rpm_version = rpm_version[:-2]
        self.assertEqual(rpm_version.replace('-', '.'), semodule_version)

    @upgrade
    @tier1
    def test_positive_check_installer_services(self):
        """Check if services start correctly

        :id: 85fd4388-6d94-42f5-bed2-24be38e9f104

        :expectedresults: All services {'elasticsearch', 'foreman-proxy',
            'foreman-tasks', 'httpd', 'rh-mongodb34-mongod', 'postgresql',
            'pulp_celerybeat', 'pulp_resource_manager', 'pulp_workers',
            'qdrouterd', 'qpidd', 'tomcat'} are started
        """
        major_version = get_host_info()[1]
        services = (
            'foreman-proxy',
            'foreman-tasks',
            'httpd',
            'rh-mongodb34-mongod',
            'postgresql',
            'pulp_celerybeat',
            'pulp_resource_manager',
            'pulp_streamer',
            'pulp_workers',
            'qdrouterd',
            'qpidd',
            'smart_proxy_dynflow_core',
            'squid',
            'tomcat6' if major_version == RHEL_6_MAJOR_VERSION else 'tomcat',
        )

        # check `services` status using service command
        if major_version >= RHEL_7_MAJOR_VERSION:
            status_format = 'systemctl status {0}'
        else:
            status_format = 'service {0} status'

        for service in services:
            with self.subTest(service):
                result = ssh.command(status_format.format(service))
                self.assertEqual(result.return_code, 0)
                self.assertEqual(len(result.stderr), 0)

        # check status reported by hammer ping command
        result = ssh.command(u'hammer -u {0[0]} -p {0[1]} ping'.format(
            settings.server.get_credentials()
        ))

        # iterate over the lines grouping every 3 lines
        # example [1, 2, 3, 4, 5, 6] will return [(1, 2, 3), (4, 5, 6)]
        for service, status, response in zip(*[iter(result.stdout)] * 3):
            service = service.replace(':', '').strip()
            status = status.split(':')[1].strip().lower()
            response = response.split(':', 1)[1].strip()
            self.assertEqual(
                status, 'ok',
                '{0} responded with {1}'.format(service, response)
            )


def extract_params(lst):
    """Generator function to extract satellite installer params from lst.
    In general lst is cmd.stdout, e.g., a list of strings representing host
    stdout

    :param lst: list  of strings
    :return: generator with all params
    """
    for line in lst:
        line = line.strip()
        first_2_tokens = line.split()[:2]
        for token in first_2_tokens:
            if token[0] == '-':
                yield token.replace(',', '')


@upgrade
@tier3
def test_installer_options_and_flags():
    """Look for changes on installer options and flags

    :id: a51d3b9f-f347-4a96-a31a-770349db08c7

    :Steps:
        1. parse installer options and flags
        2. compare with last options

    :expectedresults: Ideally options should not change on zstreams.
        Documentation must be updated accordingly when such changes occur.
        So when this test fail we QE can act on it, asking dev if
        changes occurs on zstream and checking docs are up to date.

    :CaseImportance: Medium
    """
    stdout = ssh.command('satellite-installer --full-help').stdout

    current_installer_options = set(extract_params(stdout or []))
    removed_options = list(
        PREVIOUS_INSTALLER_OPTIONS - current_installer_options)
    removed_options.sort()
    added_options = list(
        current_installer_options - PREVIOUS_INSTALLER_OPTIONS)
    added_options.sort()
    msg = "###Removed options:\n{}\n###Added options:\n{}".format(
        removed_options, added_options
    )
    assert PREVIOUS_INSTALLER_OPTIONS == current_installer_options, msg
