Skip to content

Commit fe8231f

Browse files
committed
update test by removing pexpect
Replace w/ network directory
1 parent 975d270 commit fe8231f

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

test/namespace_admin_test.py

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from pathlib import Path
55
from typing import Callable, Optional
66

7-
import pexpect
87
from test_base import TestBase
98

109
from warnet.k8s import get_kubeconfig_value
@@ -21,6 +20,9 @@ def __init__(self):
2120
/ "namespaces"
2221
/ "two_namespaces_two_users"
2322
)
23+
self.network_dir = (
24+
Path(os.path.dirname(__file__)) / "data" / "admin" / "networks" / "6_node_bitcoin"
25+
)
2426

2527
def run_test(self):
2628
try:
@@ -56,37 +58,10 @@ def setup_service_accounts(self):
5658
self.wait_for_predicate(self.service_accounts_are_validated)
5759

5860
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}")
8661
self.log.info("Deploy networks to team namespaces")
8762
for namespace in self.get_namespaces():
8863
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}"))
9065
self.wait_for_all_tanks_status()
9166
self.log.info("Waiting for all edges")
9267
self.wait_for_all_edges()

0 commit comments

Comments
 (0)