4
4
from pathlib import Path
5
5
from typing import Callable , Optional
6
6
7
- import pexpect
8
7
from test_base import TestBase
9
8
10
9
from warnet .k8s import get_kubeconfig_value
@@ -21,6 +20,9 @@ def __init__(self):
21
20
/ "namespaces"
22
21
/ "two_namespaces_two_users"
23
22
)
23
+ self .network_dir = (
24
+ Path (os .path .dirname (__file__ )) / "data" / "admin" / "networks" / "6_node_bitcoin"
25
+ )
24
26
25
27
def run_test (self ):
26
28
try :
@@ -56,37 +58,10 @@ def setup_service_accounts(self):
56
58
self .wait_for_predicate (self .service_accounts_are_validated )
57
59
58
60
def deploy_network_in_team_namespaces (self ):
59
- network_name = "teamnet"
60
- up = "\x1b [A"
61
- down = "\x1b [B"
62
- self .log .info (f"Create a warnet network chart called '{ network_name } '" )
63
- child = pexpect .spawn ("warnet init" )
64
- child .expect ("Do you want to create a custom network" )
65
- child .sendline ("y" )
66
- child .expect ("Enter your network name" )
67
- child .sendline (network_name )
68
- child .expect ("How many nodes would you like" )
69
- child .send (down ) # > 20
70
- child .send (down ) # > 50
71
- child .send (down ) # > other
72
- child .sendline ()
73
- child .expect ("How many connections would you like each node to have" )
74
- child .send (up ) # > 2
75
- child .sendline ()
76
- child .expect ("Which version would you like nodes to run by default" )
77
- child .sendline ()
78
- child .expect ("Enter the number of nodes" )
79
- child .sendline ("2" )
80
- child .expect ("Would you like to enable fork-observer on the network" )
81
- child .sendline ("False" )
82
- child .expect ("Would you like to enable grafana logging on the network" )
83
- child .sendline ("False" )
84
- child .expect (pexpect .EOF )
85
- self .log .info (f"Created the network chart called: { network_name } " )
86
61
self .log .info ("Deploy networks to team namespaces" )
87
62
for namespace in self .get_namespaces ():
88
63
self .log .info (f"Deploying network into: { namespace } " )
89
- self .log .info (self .warnet (f"deploy networks/ { network_name } / --namespace { namespace } " ))
64
+ self .log .info (self .warnet (f"deploy { self . network_dir } --namespace { namespace } " ))
90
65
self .wait_for_all_tanks_status ()
91
66
self .log .info ("Waiting for all edges" )
92
67
self .wait_for_all_edges ()
0 commit comments