Example #1
0
 def security_keystone_tls_enablement_check(self, *args, **kwargs):
     testcase_input_file = ""
     try:
         testcase_input_file =\
             cfg.CONF.security_pulse_test.testcase_input_file
     except Exception as e:
         print("Exception while reading the testcase input file")
         return (404, e.message, [])
     if not os.path.isfile(testcase_input_file):
         print("Security Testcase input file not found")
         return (404, "Security Testcase input file not found", [])
     # print testcase_input_file
     base_dir = os.path.dirname(cloudpulse.__file__)
     input_reader = security_test_input_reader(testcase_input_file)
     input_data = input_reader.process_security_input_file()
     input_params = security_pulse_test_util.\
         get_test_input_by_name("tls_enablement_check", input_data)
     os_node_info_obj = \
         openstack_node_info_reader(base_dir +
                                    "/scenario/plugins/security_pulse/" +
                                    "config/openstack_config.yaml")
     openstack_node_list = os_node_info_obj.get_host_list()
     input_params['os_host_list'] = openstack_node_list
     # print input_params
     tls_test = tls_enablement_test()
     result = tls_test.perform_tls_enablement_test(input_params)
     if not result:
         return (404, "No result from test execution", [])
     # print result
     if result.startswith("Fail"):
         return (404, result, [])
     else:
         return (200, result, [])
 def security_keystone_tls_enablement_check(self, *args, **kwargs):
     testcase_input_file = ""
     try:
         testcase_input_file =\
             cfg.CONF.security_pulse_test.testcase_input_file
     except Exception as e:
         print ("Exception while reading the testcase input file")
         return (404, json.dumps([{'Message': e.message}]), [])
     if not os.path.isfile(testcase_input_file):
         print ("Security Testcase input file not found")
         msg = {'Message': "Security Testcase input file not found"}
         return (404, json.dumps([msg]), [])
     # base_dir = os.path.dirname(cloudpulse.__file__)
     input_reader = security_test_input_reader(testcase_input_file)
     input_data = input_reader.process_security_input_file()
     input_params = security_pulse_test_util.\
         get_test_input_by_name("tls_enablement_check", input_data)
     # os_node_info_obj = \
     #     openstack_node_info_reader(base_dir +
     #                                "/scenario/plugins/security_pulse/" +
     #                                "config/openstack_config.yaml")
     os_node_info_obj = openstack_node_info_reader(
         cfg.CONF.security_pulse_test.testcase_setup_file)
     openstack_node_list = os_node_info_obj.get_host_list()
     input_params['os_host_list'] = openstack_node_list
     tls_test = tls_enablement_test()
     result = tls_test.perform_tls_enablement_test(input_params)
     return result
 def security_keystone_tls_enablement_check(self, *args, **kwargs):
     testcase_input_file = ""
     try:
         testcase_input_file =\
             cfg.CONF.security_pulse_test.testcase_input_file
     except Exception as e:
         print ("Exception while reading the testcase input file")
         return (404, e.message, [])
     if not os.path.isfile(testcase_input_file):
         print ("Security Testcase input file not found")
         return (404, "Security Testcase input file not found", [])
     # print testcase_input_file
     base_dir = os.path.dirname(cloudpulse.__file__)
     input_reader = security_test_input_reader(testcase_input_file)
     input_data = input_reader.process_security_input_file()
     input_params = security_pulse_test_util.\
         get_test_input_by_name("tls_enablement_check", input_data)
     os_node_info_obj = \
         openstack_node_info_reader(base_dir +
                                    "/scenario/plugins/security_pulse/" +
                                    "config/openstack_config.yaml")
     openstack_node_list = os_node_info_obj.get_host_list()
     input_params['os_host_list'] = openstack_node_list
     # print input_params
     tls_test = tls_enablement_test()
     result = tls_test.perform_tls_enablement_test(input_params)
     if not result:
         return (404, "No result from test execution", [])
     # print result
     if result.startswith("Fail"):
         return (404, result, [])
     else:
         return (200, result, [])