3 from robot.libraries.BuiltIn import BuiltIn
4 from robot.api import logger
6 from test_constants import *
8 sys.path.append(os.path.join(os.path.dirname(__file__), '..', '../libraries/common'))
10 ex = BuiltIn().get_library_instance('execute_command')
11 stack_infos = BuiltIn().get_library_instance('stack_infos')
14 def tc_004_ssh_file_check():
15 steps = ['step1_openstack_file_check_on_crf_nodes']
16 common_utils.keyword_runner(steps)
19 def step1_openstack_file_check_on_crf_nodes():
20 check_file(stack_infos.get_crf_nodes(), '/etc/userconfig/', crf_node_openstack_file_types)
23 def check_file(nodes, folder, files):
25 logger.info("Nodes dictionary is empty, nothing to check.")
28 logger.console("\n" + key + " " + nodes[key])
30 full_file_path = folder + f
31 command = 'ls ' + full_file_path + ' | wc -l'
32 stdout = ex.execute_unix_command_on_remote_as_user(command, nodes[key])
34 logger.console(full_file_path + " exists.")
36 raise Exception(full_file_path + " not exists !")