Skip to content

Commit

Permalink
Fix eternal nfs db tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Maslennikov committed Dec 16, 2024
1 parent da6ef55 commit b6a34e1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,14 @@ def handle_setup_new_db_test(self):
sftp.chmod(f'{self._DB_TEST_INIT_SCRIPT_PATH}/{script_name}', 0o755)

with self.module_factories.make_ssh_client(self.args.dry_run, instance.ip, ssh_key_path=self.args.ssh_key_path) as ssh:
_, stdout, stderr = ssh.exec_command(f'{self._DB_TEST_INIT_SCRIPT_PATH}/{script_name}')
_, stdout, stderr = ssh.exec_command(
f'cp {self._DB_TEST_INIT_SCRIPT_PATH}/{script_name} {self._DB_TEST_INIT_SCRIPT_PATH}/{script_name}.run')
if stdout.channel.recv_exit_status() != 0 or stderr.channel.recv_exit_status() != 0:
self.logger.error(f'Failed to copy script to instance:\n'
f'stderr: {"".join(stderr.readlines())}\n'
f'stdout: {"".join(stdout.readlines())}')
raise Error('Failed to run command')
_, stdout, stderr = ssh.exec_command(f'{self._DB_TEST_INIT_SCRIPT_PATH}/{script_name}.run')
exit_code = stdout.channel.recv_exit_status()
if exit_code != 0:
self.logger.error(f'Failed to prepare db test:\n'
Expand Down

0 comments on commit b6a34e1

Please sign in to comment.