Skip to content

Commit 517a3a8

Browse files
committed
Fix tests
1 parent 275c7d5 commit 517a3a8

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

tests/firewall/default_rule_controller_test.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11

2+
import concurrent.futures
23
import mock
4+
import os
5+
import shutil
6+
37
import pytest
4-
import concurrent.futures
58

69
from skale.schain_config import PORTS_PER_SCHAIN # noqa
710

@@ -21,7 +24,17 @@ def refresh():
2124
run_cmd(['nft', 'flush', 'ruleset'])
2225

2326

24-
def test_get_default_rule_controller():
27+
@pytest.fixture()
28+
def nft_chain_folder():
29+
path = '/etc/nft.conf.d/chains'
30+
try:
31+
os.makedirs(path)
32+
yield path
33+
finally:
34+
shutil.rmtree(path)
35+
36+
37+
def test_get_default_rule_controller(nft_chain_folder):
2538
own_ip = '3.3.3.3'
2639
node_ips = ['1.1.1.1', '2.2.2.2', '3.3.3.3', '4.4.4.4']
2740
base_port = 10064
@@ -175,7 +188,7 @@ def run_concurrent_rc_syncing(
175188

176189

177190
@pytest.mark.parametrize('attempt', range(5))
178-
def test_concurrent_rc_behavior_no_refresh(attempt):
191+
def test_concurrent_rc_behavior_no_refresh(attempt, nft_chain_folder):
179192
node_number = 16
180193
schain_number = 8
181194
own_ip = '1.1.1.1'
@@ -191,7 +204,7 @@ def test_concurrent_rc_behavior_no_refresh(attempt):
191204

192205

193206
@pytest.mark.parametrize('attempt', range(5))
194-
def test_concurrent_rc_behavior_with_refresh(attempt, refresh):
207+
def test_concurrent_rc_behavior_with_refresh(attempt, refresh, nft_chain_folder):
195208
node_number = 16
196209
schain_number = 8
197210
own_ip = '1.1.1.1'

0 commit comments

Comments
 (0)