Esempio n. 1
0
    def test_configure_unmanaged_ad(self):
        json_data = use_cases.get_unmanged_ad_use_case()

        self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR +
                           "/scripts/kerberos_client.py",
                           classname="KerberosClient",
                           command="configure",
                           config_dict=json_data,
                           stack_version=self.STACK_VERSION,
                           target=RMFTestCase.TARGET_COMMON_SERVICES)

        self.assertResourceCalled('Directory',
                                  use_cases.get_krb5_conf_dir(json_data),
                                  owner='root',
                                  group='root',
                                  mode=0755,
                                  create_parents=True)

        file_path = (use_cases.get_krb5_conf_dir(json_data) + "/" +
                     use_cases.get_krb5_conf_file(json_data))
        self.assertResourceCalled(
            'File',
            file_path,
            content=InlineTemplate(
                use_cases.get_krb5_conf_template(json_data)),
            owner='root',
            group='root',
            mode=0644)
  def test_configure_unmanaged_ad(self):
    json_data = use_cases.get_unmanged_ad_use_case()

    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kerberos_client.py",
                       classname="KerberosClient",
                       command="configure",
                       config_dict=json_data,
                       hdp_stack_version = self.STACK_VERSION,
                       target = RMFTestCase.TARGET_COMMON_SERVICES
    )

    self.assertResourceCalled('Directory', use_cases.get_krb5_conf_dir(json_data),
                              owner='root',
                              group='root',
                              mode=0755,
                              recursive=True)

    file_path = (use_cases.get_krb5_conf_dir(json_data) +
                 "/" +
                 use_cases.get_krb5_conf_file(json_data))
    self.assertResourceCalled('File', file_path,
                              content=InlineTemplate(use_cases.get_krb5_conf_template(json_data)),
                              owner='root',
                              group='root',
                              mode=0644)
Esempio n. 3
0
  def test_configure_managed_kdc(self):
    json_data = use_cases.get_manged_kdc_use_case()

    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kerberos_server.py",
                       classname="KerberosServer",
                       command="configure",
                       config_dict=json_data,
                       stack_version = self.STACK_VERSION,
                       target = RMFTestCase.TARGET_COMMON_SERVICES
    )

    # Validate krb5.conf file
    self.assertResourceCalled('Directory', use_cases.get_krb5_conf_dir(json_data),
                              owner='root',
                              group='root',
                              mode=0755,
                              create_parents = True)

    file_path = (use_cases.get_krb5_conf_dir(json_data) +
                 "/" +
                 use_cases.get_krb5_conf_file(json_data))
    self.assertResourceCalled('File', file_path,
                              content=Template('krb5_conf.j2'),
                              owner='root',
                              group='root',
                              mode=0644)

    # Validate kdc.conf file
    self.assertResourceCalled('Directory', use_cases.get_kdc_conf_dir(json_data),
                              owner='root',
                              group='root',
                              mode=0700,
                              create_parents = True)

    file_path = (use_cases.get_kdc_conf_dir(json_data) +
                 "/" +
                 use_cases.get_kdc_conf_file(json_data))
    self.assertResourceCalled('File', file_path,
                              content=Template('kdc_conf.j2'),
                              owner='root',
                              group='root',
                              mode=0600)

    # Validate kadm5.acl file
    self.assertResourceCalled('Directory', use_cases.get_kadm5_acl_dir(json_data),
                              owner='root',
                              group='root',
                              mode=0700,
                              create_parents = True)

    file_path = (use_cases.get_kadm5_acl_dir(json_data) +
                 "/" +
                 use_cases.get_kadm5_acl_file(json_data))
    self.assertResourceCalled('File', file_path,
                              content=Template('kadm5_acl.j2'),
                              owner='root',
                              group='root',
                              mode=0600)
    def test_configure_unmanaged_kdc(self):
        json_data = use_cases.get_unmanged_kdc_use_case()

        self.executeScript(
            self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/kerberos_server.py",
            classname="KerberosServer",
            command="configure",
            config_dict=json_data,
            hdp_stack_version=self.STACK_VERSION,
            target=RMFTestCase.TARGET_COMMON_SERVICES,
        )

        # Validate krb5.conf file
        self.assertResourceCalled(
            "Directory", use_cases.get_krb5_conf_dir(json_data), owner="root", group="root", mode=0755, recursive=True
        )

        file_path = use_cases.get_krb5_conf_dir(json_data) + "/" + use_cases.get_krb5_conf_file(json_data)
        self.assertResourceCalled(
            "File",
            file_path,
            content=InlineTemplate(use_cases.get_krb5_conf_template(json_data)),
            owner="root",
            group="root",
            mode=0644,
        )

        # Validate kdc.conf file
        self.assertResourceCalled(
            "Directory", use_cases.get_kdc_conf_dir(json_data), owner="root", group="root", mode=0700, recursive=True
        )

        file_path = use_cases.get_kdc_conf_dir(json_data) + "/" + use_cases.get_kdc_conf_file(json_data)
        self.assertResourceCalled(
            "File",
            file_path,
            content=InlineTemplate(use_cases.get_kdc_conf_template(json_data)),
            owner="root",
            group="root",
            mode=0600,
        )

        # Validate kadm5.acl file
        self.assertResourceCalled(
            "Directory", use_cases.get_kadm5_acl_dir(json_data), owner="root", group="root", mode=0700, recursive=True
        )

        file_path = use_cases.get_kadm5_acl_dir(json_data) + "/" + use_cases.get_kadm5_acl_file(json_data)
        self.assertResourceCalled(
            "File",
            file_path,
            content=InlineTemplate(use_cases.get_kadm5_acl_template(json_data)),
            owner="root",
            group="root",
            mode=0600,
        )