def test_ipa_console(self): tasks.kinit_admin(self.master) result = self.master.run_command(["ipa", "console"], stdin_text="api.env") assert "ipalib.config.Env" in result.stdout_text filename = tasks.upload_temp_contents(self.master, "print(api.env)\n") result = self.master.run_command(["ipa", "console", filename], ) assert "ipalib.config.Env" in result.stdout_text
def install(cls, mh): pki_ini = tasks.upload_temp_contents(cls.master, KEY_OVERRIDE) extra_args = [ '--pki-config-override', pki_ini, ] tasks.install_master( cls.master, setup_dns=False, extra_args=extra_args ) cls.master.run_command(['rm', '-f', pki_ini])
def install(cls, mh): pki_ini = tasks.upload_temp_contents(cls.master, KEY_OVERRIDE) extra_args = [ '--pki-config-override', pki_ini, ] tasks.install_master(cls.master, setup_dns=False, extra_args=extra_args) cls.master.run_command(['rm', '-f', pki_ini])
def test_advice_config_client_for_smart_card_auth(self): advice_id = 'config_client_for_smart_card_auth' advice_regex = r"\#\!\/bin\/sh.*" run_advice(self.master, advice_id, advice_regex) client = self.clients[0] ca_pem = ExternalCA().create_ca() ca_file = tasks.upload_temp_contents(client, ca_pem) try: self.execute_advise(client, advice_id, ca_file) finally: client.run_command(['rm', '-f', ca_file])
def execute_advise(self, host, advice_id, *args): # ipa-advise script is only available on a server tasks.kinit_admin(self.master) advice = self.master.run_command(['ipa-advise', advice_id]) # execute script on host (client or master) if host is not self.master: tasks.kinit_admin(host) filename = tasks.upload_temp_contents(host, advice.stdout_text) cmd = ['sh', filename] cmd.extend(args) try: result = host.run_command(cmd) finally: host.run_command(['rm', '-f', filename]) return advice, result
def test_ipa_console(self): tasks.kinit_admin(self.master) result = self.master.run_command( ["ipa", "console"], stdin_text="api.env" ) assert "ipalib.config.Env" in result.stdout_text filename = tasks.upload_temp_contents( self.master, "print(api.env)\n" ) result = self.master.run_command( ["ipa", "console", filename], ) assert "ipalib.config.Env" in result.stdout_text
def test_advice_config_server_for_smart_card_auth(self): advice_id = 'config_server_for_smart_card_auth' advice_regex = r"\#\!\/bin\/sh.*" run_advice(self.master, advice_id, advice_regex) ca_pem = ExternalCA().create_ca() ca_file = tasks.upload_temp_contents(self.master, ca_pem) try: self.execute_advise(self.master, advice_id, ca_file) except Exception: # debug: sometimes ipa-certupdate times out in # "Resubmitting certmonger request" self.master.run_command(['getcert', 'list']) raise finally: self.master.run_command(['rm', '-f', ca_file]) sssd_conf = self.master.get_file_contents(paths.SSSD_CONF, encoding='utf-8') assert constants.HTTPD_USER in sssd_conf assert IPAAPI_USER in sssd_conf
def test_advice_config_server_for_smart_card_auth(self): advice_id = 'config_server_for_smart_card_auth' advice_regex = r"\#\!\/bin\/sh.*" run_advice(self.master, advice_id, advice_regex) ca_pem = ExternalCA().create_ca() ca_file = tasks.upload_temp_contents(self.master, ca_pem) try: self.execute_advise(self.master, advice_id, ca_file) except Exception: # debug: sometimes ipa-certupdate times out in # "Resubmitting certmonger request" self.master.run_command(['getcert', 'list']) raise finally: self.master.run_command(['rm', '-f', ca_file]) sssd_conf = self.master.get_file_contents( paths.SSSD_CONF, encoding='utf-8' ) assert constants.HTTPD_USER in sssd_conf assert IPAAPI_USER in sssd_conf