Ejemplo n.º 1
0
  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,
                       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=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,
                              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=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,
                              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=InlineTemplate(use_cases.get_kadm5_acl_template(json_data)),
                              owner='root',
                              group='root',
                              mode=0600)
Ejemplo n.º 2
0
    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,
        )