forked from TrueCloudLab/frostfs-testcases
Switch failover test to hosting from testlib
Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
This commit is contained in:
parent
92c034c10b
commit
48e53b3d86
20 changed files with 242 additions and 441 deletions
|
@ -1,16 +1,13 @@
|
|||
from ssh_helper import HostClient
|
||||
from neofs_testlib.shell import Shell
|
||||
|
||||
|
||||
# TODO: convert to shell from hosting
|
||||
class IpTablesHelper:
|
||||
@staticmethod
|
||||
def drop_input_traffic_to_port(client: HostClient, ports: list[str]):
|
||||
def drop_input_traffic_to_port(shell: Shell, ports: list[str]) -> None:
|
||||
for port in ports:
|
||||
cmd_output = client.exec(cmd=f"sudo iptables -A INPUT -p tcp --dport {port} -j DROP")
|
||||
assert cmd_output.rc == 0
|
||||
shell.exec(f"sudo iptables -A INPUT -p tcp --dport {port} -j DROP")
|
||||
|
||||
@staticmethod
|
||||
def restore_input_traffic_to_port(client: HostClient, ports: list[str]):
|
||||
def restore_input_traffic_to_port(shell: Shell, ports: list[str]) -> None:
|
||||
for port in ports:
|
||||
cmd_output = client.exec(cmd=f"sudo iptables -D INPUT -p tcp --dport {port} -j DROP")
|
||||
assert cmd_output.rc == 0
|
||||
shell.exec(f"sudo iptables -D INPUT -p tcp --dport {port} -j DROP")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue