Add test for network failover
Signed-off-by: a.y.volkov <a.y.volkov@yadro.com>
This commit is contained in:
parent
5f53e80f93
commit
642af0a888
9 changed files with 247 additions and 67 deletions
16
pytest_tests/helpers/iptables_helper.py
Normal file
16
pytest_tests/helpers/iptables_helper.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
from ssh_helper import HostClient
|
||||
|
||||
|
||||
class IpTablesHelper:
|
||||
|
||||
@staticmethod
|
||||
def drop_input_traffic_to_port(client: HostClient, ports: list[str]):
|
||||
for port in ports:
|
||||
cmd_output = client.exec(cmd=f'iptables -A INPUT -p tcp --dport {port} -j DROP')
|
||||
assert cmd_output.rc == 0
|
||||
|
||||
@staticmethod
|
||||
def restore_input_traffic_to_port(client: HostClient, ports: list[str]):
|
||||
for port in ports:
|
||||
cmd_output = client.exec(cmd=f'iptables -D INPUT -p tcp --dport {port} -j DROP')
|
||||
assert cmd_output.rc == 0
|
Loading…
Add table
Add a link
Reference in a new issue