From b6ece28856aa36dba6304dca4bac57f552ff0a6a Mon Sep 17 00:00:00 2001 From: René Genz Date: Feb 13 2018 14:46:08 +0000 Subject: Fix minor spelling mistakes in PY files in tests/python/* Merges: https://pagure.io/SSSD/sssd/pull-request/3611 Reviewed-by: Niranjan M.R --- diff --git a/src/tests/python/sssd/testlib/common/authconfig.py b/src/tests/python/sssd/testlib/common/authconfig.py index 4dbee6f..99493ac 100644 --- a/src/tests/python/sssd/testlib/common/authconfig.py +++ b/src/tests/python/sssd/testlib/common/authconfig.py @@ -27,13 +27,13 @@ FILES_TO_NOT_BACKUP = ['passwd', 'group', 'shadow', 'gshadow'] class RedHatAuthConfig(object): """ - AuthConfig class implements system-independent interface to configure + AuthConfig class implements a system-independent interface to configure system authentication resources. In Red Hat systems this is done with authconfig(8) utility. AuthConfig class is nothing more than a tool to gather configuration - options and execute their processing. These options then converted by - an actual implementation to series of a system calls to appropriate + options and execute their processing. These options are then converted by + an actual implementation to a series of system calls to appropriate utilities performing real configuration. If you need to re-use existing AuthConfig instance for multiple runs, @@ -73,7 +73,7 @@ class RedHatAuthConfig(object): def add_parameter(self, option, value): """ - Add paramters + Add parameters :param str option: authconfig options :param str values: values """ diff --git a/src/tests/python/sssd/testlib/common/exceptions.py b/src/tests/python/sssd/testlib/common/exceptions.py index cdd74ed..1839a59 100644 --- a/src/tests/python/sssd/testlib/common/exceptions.py +++ b/src/tests/python/sssd/testlib/common/exceptions.py @@ -25,7 +25,7 @@ class InvalidInput(StandardException): class DirSrvException(StandardException): """ - Override StandardException, This exception s to be used for + Override StandardException, This exception is to be used for Directory Server related Errors """ @@ -52,5 +52,5 @@ class LdapException(StandardException): class RPMException(StandardException): """ - Override StandardException, This exception is to be used for LDAP Errors + Override StandardException, This exception is to be used for RPM Errors """ diff --git a/src/tests/python/sssd/testlib/common/libdirsrv.py b/src/tests/python/sssd/testlib/common/libdirsrv.py index 710d324..1bca4b1 100644 --- a/src/tests/python/sssd/testlib/common/libdirsrv.py +++ b/src/tests/python/sssd/testlib/common/libdirsrv.py @@ -86,7 +86,7 @@ class DirSrv(object): ds_config_file (str): ds_config_file: Configuration File path Returns: - bool: True if seutp-ds.pl ran successfully else False + bool: True if setup-ds.pl ran successfully else False Exceptions: subprocess.CalledProcessError: @@ -134,9 +134,9 @@ class DirSrv(object): Exceptions: DirSrvException """ - # we stop directory server before we copy files , this is required + # We stop directory server before we copy files. This is required # because it's seen that at times, if ns-slapd process is reading - # the db files, copying of files is successfull but not all data + # the db files, copying of files is successful but not all data # is written causing the files to go corrupt. stop_ds = ['systemctl', 'stop', 'dirsrv@%s' % (self.instance_name)] try: @@ -165,12 +165,12 @@ class DirSrv(object): self.multihost.run_command(change_ownership) except subprocess.CalledProcessError: raise DirSrvException( - 'fail to user change ownerhsip of pin.txt fail') + 'fail to user change ownership of pin.txt fail') try: self.multihost.run_command(change_group) except subprocess.CalledProcessError: raise DirSrvException( - 'fail to change group ownerhsip of pin.txt file') + 'fail to change group ownership of pin.txt file') try: self.multihost.run_command(chmod_file) except subprocess.CalledProcessError: @@ -189,11 +189,11 @@ class DirSrv(object): """sets TLS Port and enabled TLS on Directory Server. Args: - binduri (str): ldap uri to bind with + binduri (str): LDAP uri to bind with tls_port (str): TLS port to be setup Returns: - bool: True if successfully setup TLSPort + bool: True if successfully setup TLS port Exceptions: LdapException @@ -249,14 +249,14 @@ class DirSrvWrap(object): """This is a wrapper class for DirSrv. This is a wrapper class of DirSrv class which validates - all the inpts sent to Dirsrv object. Specifies ports for - ldap and tls ports , specifies default suffix. + all the inputs sent to Dirsrv object. Specifies ports for + LDAP and TLS ports, specifies default suffix. """ # pylint: disable=too-many-instance-attributes def __init__(self, multihost_obj, ssl=None, ssldb=None): """ Create a DirSrv object for a specific Host. Specify the ports, - Instance details to the Dirsrv object + instance details to the Dirsrv object Args: multihost_obj (obj): Multihost object @@ -297,11 +297,11 @@ class DirSrvWrap(object): instance_name (str): DS Instance Name instance_suffix (str): DS Instance Suffix root_dn_pwd (str): Directory Manager password - ldap_port (str): ldap port + ldap_port (str): LDAP port tls_port (str): TLS Port Returns: - A tuple containing 'Success' ,0 or Failed Message and 1 + A tuple containing 'Success', 0 or Failed Message and 1 for failure to setup ports Exceptions: @@ -339,23 +339,23 @@ class DirSrvWrap(object): """return ports required to setup DS Instance. Idea behind this is when a directory server instance needs - to be created we need ports for ldap and ssl ports. - 1. check if LdapPort and SSLPort is given + to be created we need ports for LDAP and SSL ports. + 1. check if LDAP port and SSL port is given 1.1 If given, verify if the ports are available(not used) 1.1.1 Bind that port to ldap_port_t using semanage command 1.1.2 Use the ports and add it to the self.UsedPorts list 1.2 else raise exception - 2. If LdapPort and SSLPort is not given + 2. If LDAP port and SSL port is not given 2.1 Check if the ports are available(not used) 2.1.1 Bind the port to ldap_port_t using semanage command 2.1.2 Use the ports and add it to self.ds_used_ports list Args: - u_port (str): unencrypted ldap port + u_port (str): unencrypted LDAP port e_port (str): Encrypted port to be used for TLS Returns: - sorted_available_ports[0] (list): ldap and tls ports + sorted_available_ports[0] (list): LDAP and TLS ports """ ds_ports = [389, 1389, 2389, 3389, 4389, 30389, 31389, 32389, 33389, 34389, 35389, 36389, 37389, 38389, 39389] @@ -389,7 +389,7 @@ class DirSrvWrap(object): """check if the port on the remote host is free. Args: - port (int): check if port is avaliable + port (int): check if port is available Returns: bool: True if port is free else False. @@ -407,7 +407,7 @@ class DirSrvWrap(object): return True def _validate_options(self): - """verify if the instance directory alread exists. + """verify if the instance directory already exists. Args: None @@ -437,7 +437,7 @@ class DirSrvWrap(object): inst_name (str): Instance Name inst_suffix (str): Instance suffix root_dn_pwd (str): Directory Manager password - ldap_port (str): ldap port to be used + ldap_port (str): LDAP port to be used tls_port (str): TLS port to be used Returns: @@ -478,9 +478,9 @@ class DirSrvWrap(object): raise DirSrvException('fail to setup Directory Server instance') def enablessl(self): - """Enable ssl/tls on instance. + """Enable SSL/TLS on instance. - Enable by adding tls port to ldap_port_t selinux label and restart + Enable by adding TLS port to ldap_port_t SELinux label and restart Directory Server. Args: @@ -492,7 +492,7 @@ class DirSrvWrap(object): Exceptions: None: """ - # add tls port to ldap_port_t selinux label + # add TLS port to ldap_port_t SELinux label add_tls_port = ['semanage', 'port', '-a', '-t', 'ldap_port_t', '-p', 'tcp', str(self.ds_tls_port)] diff --git a/src/tests/python/sssd/testlib/common/libkrb5.py b/src/tests/python/sssd/testlib/common/libkrb5.py index 38b5e67..8df4449 100644 --- a/src/tests/python/sssd/testlib/common/libkrb5.py +++ b/src/tests/python/sssd/testlib/common/libkrb5.py @@ -6,13 +6,13 @@ import subprocess class krb5srv(object): - """ Base class to setup MIT kerberos server - Default Keberos Server realm is "EXAMPLE.TEST" + """ Base class to setup MIT Kerberos server + Default Kerberos Server realm is "EXAMPLE.TEST" Default Admin password is "Secret123" """ def __init__(self, multihost, krb_realm=None): - """ Initialize realm, host, ports kerberos admin password """ + """ Initialize realm, host, ports, Kerberos admin password """ if krb_realm is None: self.krb_realm = 'EXAMPLE.TEST' else: @@ -39,7 +39,7 @@ class krb5srv(object): def _config_krb5kdc(self): """ Configure kdc.conf and kadm5.acl :param: None - :return str: Return kerberos kdc.conf file path + :return str: Return Kerberos kdc.conf file path """ realm_def = """ { acl_file = %s @@ -67,7 +67,7 @@ class krb5srv(object): return krb_config_path def _krb_acl_config(self): - """ Create acl file + """ Create ACL file :param: None :return: Config file path """ @@ -79,7 +79,7 @@ class krb5srv(object): return acl_config_path def krb_setup_new(self): - """ Setup new kerberos REALM + """ Setup new Kerberos REALM :param: None :return: None :Exception: Raises subprocess.CalledProcessError @@ -139,24 +139,24 @@ class krb5srv(object): except subprocess.CalledProcessError: raise else: - self.multihost.log.info("krb5kdc service start successfully") + self.multihost.log.info("krb5kdc service start successful") try: self.multihost.run_command(['systemctl', 'start', 'kadmin']) except subprocess.CalledProcessError: raise else: - self.multihost.log.info("kadmin service started successfull") + self.multihost.log.info("kadmin service started successfully") def add_principal(self, principal=None, p_type='user', password=None, service=None, service_name=None): - """ Add server/user principals to kerberos server + """ Add server/user principals to Kerberos server :param str principal: principal name (foobar) :param str p_type: principal type (user/admin/None) - :param str password: password ('Secret123') - :param str service: service principal (host/http/nfs) + :param str password: password ('Secret123') + :param str service: service principal (host/http/nfs) :param str service_name: Hostname where service is run :return bool: True if principal is added :Exception: Raise subprocess.CalledProcessError @@ -189,11 +189,11 @@ class krb5srv(object): return True def destroy_krb5server(self): - """ Destroy kerberos database + """ Destroy Kerberos database :param: None :Exception: subprocess.CalledProcessError """ - # stop the kerberos server + # stop the Kerberos server try: self.multihost.run_command(['systemctl', 'stop', 'krb5kdc']) except subprocess.CalledProcessError: @@ -209,7 +209,7 @@ class krb5srv(object): else: self.multihost.log.info("stopped kadmin service") - # Destoy kerberos database + # destroy Kerberos database try: self.multihost.run_command(['kdb5_util', 'destroy', '-f', self.krb_realm]) diff --git a/src/tests/python/sssd/testlib/common/qe_class.py b/src/tests/python/sssd/testlib/common/qe_class.py index eb5ee96..30b050e 100644 --- a/src/tests/python/sssd/testlib/common/qe_class.py +++ b/src/tests/python/sssd/testlib/common/qe_class.py @@ -55,7 +55,7 @@ class QeConfig(pytest_multihost.config.Config): class QeBaseHost(pytest_multihost.host.BaseHost): - """QeBaseHost subclass of multhost plugin BaseHost class.""" + """QeBaseHost subclass of multihost plugin BaseHost class.""" pass @@ -147,7 +147,7 @@ class QeHost(QeBaseHost): return cmd.returncode def dnf_install(self, package): - """ Install packges through dnf + """ Install packages through dnf :param str package: Name of the package to be installed :return str: Returncode of the dnf command @@ -188,7 +188,7 @@ class QeWinHost(QeBaseHost, pytest_multihost.host.WinHost): Attributes: domainname (str): Return domainname of the AD Machine - realm (str): Return AD realm in uppper case + realm (str): Return AD realm in upper case """ @property @@ -250,7 +250,7 @@ class QeDomain(pytest_multihost.config.Domain): @pytest.yield_fixture(scope="session", autouse=True) def session_multihost(request): - """Mulithost plugin fixture for session scope""" + """Multihost plugin fixture for session scope""" if pytest.num_ad > 0: mh = make_multihost_fixture(request, descriptions=[ { diff --git a/src/tests/python/sssd/testlib/common/utils.py b/src/tests/python/sssd/testlib/common/utils.py index 7bfb001..f5e9c66 100644 --- a/src/tests/python/sssd/testlib/common/utils.py +++ b/src/tests/python/sssd/testlib/common/utils.py @@ -35,7 +35,7 @@ class sssdTools(object): self.authbackup = "/root/authconfig_backup" def update_resolv_conf(self, ip_addr): - """ Update /etc/resolv.conf with Windows AD ipaddress + """ Update /etc/resolv.conf with Windows AD IP address :param str ip_addr: IP Address to be added in resolv.conf :return: None @@ -46,7 +46,7 @@ class sssdTools(object): '/etc/resolv.conf.backup'], set_env=False, raiseonerr=False) if output.returncode == 0: - self.multihost.log.info("/etc/resolv.conf successfully backedup") + self.multihost.log.info("/etc/resolv.conf successfully backed up") self.multihost.log.info("Add ip addr %s in resolv.conf" % ip_addr) nameserver = 'nameserver %s\n' % ip_addr contents = self.multihost.get_file_contents('/etc/resolv.conf') @@ -57,11 +57,11 @@ class sssdTools(object): raise Exception("Updating resolv.conf with ip %s failed" % ip_addr) def config_authconfig(self, hostname, domainname): - """ Run authconfig to configure kerberos and sssd auth on remote host + """ Run authconfig to configure Kerberos and SSSD auth on remote host :param str hostname: Hostname of server(AD) to which client is configured to auth - :param domainame: Domain name of ipa/AD + :param domainname: domain name of IPA/AD :return: None :Exceptions: None """ @@ -83,7 +83,7 @@ class sssdTools(object): def config_smb_net_ads_join(self, domainname): """ Configure smb.conf as Domain Member to Windows AD - :param str domainname: Domainname of AD/ipa + :param str domainname: domain name of AD/IPA :return: None :Exception: None """ @@ -109,12 +109,12 @@ class sssdTools(object): server_software='active-directory', membership_software='adcli'): """ Join system to AD/IPA Domain using realmOA - :param str domainame: Domainname of AD/ipa + :param str domainname: domain name of AD/IPA :param str admin_password: Administrator password required to join :param str client_software: client software to be used (sssd/samba) :param str server_software: server software (active-directory/ipa) :param str membership_software: membership software (samba/adcli) - :return bool: True if successfully joined to AD/ipa + :return bool: True if successfully joined to AD/IPA else raises Exception :Exception: Raises exception(builtin) """ @@ -137,8 +137,8 @@ class sssdTools(object): def realm_leave(self, domainname): """ Leave system from AD/IPA Domain - :param str domainame: Domainname of AD/ipa - :return bool: True if successfully dis-joined to AD/ipa + :param str domainname: domain name of AD/IPA + :return bool: True if successfully dis-joined to AD/IPA else raises Exception :Exception: Raises exception(builtin) """ @@ -221,7 +221,7 @@ class sssdTools(object): def delete_sssd_domain_log(self, domainname): """ Remove the sssd domain log - :param str cache_path: Domainname from default configuration file + :param str cache_path: domain name from default configuration file :return bool: True if deletion is successful :Exception: Raises exception(builtin) """ @@ -490,7 +490,7 @@ class LdapOperations(object): return 'Success', True def posix_user(self, org_unit, basedn, user_attr): - """ Add Posix Users + """ Add POSIX Users :param str ou: Organizational unit (ou=Users) :param str basedn: Base dn ('dc=example,dc=test') :param dict user_attr: Entry attributes @@ -545,7 +545,7 @@ class LdapOperations(object): raise Exception('Unable to add User to ldap') def posix_group(self, org_unit, basedn, group_attr): - """ Add posix group + """ Add POSIX group :param str ou: Organizational unit (ou=Groups) :param str basedn: Base dn ('dc=example,dc=test') :param dict group_attr: Entry attributes @@ -620,7 +620,7 @@ nisMapName: auto.home""") % (basedn, basedn, basedn, basedn, basedn, basedn) class PkiTools(object): """ PkiTools consists of functions related to creation of - certificate requests, updating profile xml with certificate + certificate requests, updating profile XML with certificate requests. """ @@ -870,7 +870,7 @@ class ADOperations(object): """ Delete AD user :param str user_group: User or Group Name to be deleted - :Return bool: True if delete is successfull else false + :Return bool: True if delete is successful else false :Exceptions: None """