Пример #1
0
 def setUp(self):
     # pylint cannot possibly know this is being mixed into TestCase classes
     # pylint: disable=invalid-name
     self.booth_dir = get_tmp_dir("tier1_booth")
     self.booth_cfg_path = os.path.join(self.booth_dir.name, "booth.cfg")
     self.booth_key_path = os.path.join(self.booth_dir.name, "booth.key")
     self.temp_cib = get_tmp_file("tier1_booth")
     write_file_to_tmpfile(EMPTY_CIB, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Пример #2
0
 def setUp(self):
     self.public_dir = get_tmp_dir("tier0_daemon_app_spa")
     self.spa_dir_path = os.path.join(self.public_dir.name, "ui")
     os.makedirs(self.spa_dir_path)
     self.fallback_path = os.path.join(self.public_dir.name, "fallback.html")
     self.index_path = os.path.join(self.spa_dir_path, "index.html")
     self.index_content = "<html/>"
     with open(self.index_path, "w") as index:
         index.write(self.index_content)
     super().setUp()
Пример #3
0
 def setUp(self):
     self.mock_runner = mock.MagicMock(spec_set=CommandRunner)
     self.original_path = settings.corosync_qdevice_net_client_certs_dir
     self.cert_dir = get_tmp_dir("tier0_lib_corosync_qdevice_net")
     settings.corosync_qdevice_net_client_certs_dir = self.cert_dir.name
     self.ca_file_path = os.path.join(
         settings.corosync_qdevice_net_client_certs_dir,
         settings.corosync_qdevice_net_client_ca_file_name,
     )
     with open(self.ca_file_path, "w") as my_file:
         my_file.write("to be overwritten")
Пример #4
0
 def setUp(self):
     # pylint cannot possibly know this is being mixed into TestCase classes
     # pylint: disable=invalid-name
     self.ssl_dir = get_tmp_dir("tier0_daemon_ssl")
     self.cert_path = os.path.join(self.ssl_dir.name, "daemon.cert")
     self.key_path = os.path.join(self.ssl_dir.name, "daemon.key")
     # various versions of OpenSSL / PyOpenSSL emit different messages
     self.DAMAGED_SSL_FILES_ERRORS_1 = (
         f"Invalid SSL certificate '{self.cert_path}':"
         " 'PEM routines:PEM_read_bio:no start line'",
         f"Invalid SSL key '{self.key_path}':"
         " 'PEM routines:PEM_read_bio:no start line'",
     )
     self.DAMAGED_SSL_FILES_ERRORS_2 = (
         f"Invalid SSL certificate '{self.cert_path}':"
         " 'PEM routines:get_name:no start line'",
         f"Invalid SSL key '{self.key_path}':"
         " 'PEM routines:get_name:no start line'",
     )
Пример #5
0
 def setUp(self):
     self.uid_gid_dir = get_tmp_dir("tier1_cluster_uidgid")
Пример #6
0
 def setUp(self):
     # pylint cannot possibly know this is being mixed into TestCase classes
     # pylint: disable=invalid-name
     self.ssl_dir = get_tmp_dir("tier0_daemon_ssl")
     self.cert_path = os.path.join(self.ssl_dir.name, "daemon.cert")
     self.key_path = os.path.join(self.ssl_dir.name, "daemon.key")
Пример #7
0
 def setUp(self):
     self.cib_dir = get_tmp_dir("tier1_misc_empty_cib")
     self.pcs_runner = PcsRunner(os.path.join(self.cib_dir.name, "cib.xml"))
Пример #8
0
 def setUp(self):
     self.wrapper = fixtures_app.RubyPcsdWrapper(ruby_pcsd.SINATRA_GUI)
     self.public_dir = get_tmp_dir("tier0_daemon_app_gui")
     super().setUp()