File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ import os
4+ from pathlib import Path
5+
6+ import pexpect
7+ from test_base import TestBase
8+
9+
10+ class HooksTest (TestBase ):
11+ def __init__ (self ):
12+ super ().__init__ ()
13+ self .network_dir = Path (os .path .dirname (__file__ )) / "data" / "12_node_ring"
14+
15+ def run_test (self ):
16+ try :
17+ os .chdir (self .tmpdir )
18+ self .setup_network ()
19+ self .generate_plugin_dir ()
20+
21+ finally :
22+ self .cleanup ()
23+
24+ def setup_network (self ):
25+ self .log .info ("Setting up network" )
26+ self .log .info (self .warnet (f"deploy { self .network_dir } " ))
27+ self .wait_for_all_tanks_status (target = "running" )
28+ self .wait_for_all_edges ()
29+
30+ def generate_plugin_dir (self ):
31+ self .log .info ("Generating the plugin directroy" )
32+ self .sut = pexpect .spawn ("warnet init" )
33+ self .sut .expect ("Do you want to create a custom network?" , timeout = 10 )
34+ self .sut .sendline ("n" )
35+ plugin_dir = Path (os .getcwd ()) / "plugins"
36+ assert plugin_dir .exists ()
37+
38+
39+ if __name__ == "__main__" :
40+ test = HooksTest ()
41+ test .run_test ()
You can’t perform that action at this time.
0 commit comments