Skip to content

Commit 02f9d3e

Browse files
fix(oracle): merge fixes from Mitchell's branch
2 parents b29a687 + 7119ea2 commit 02f9d3e

File tree

1 file changed

+76
-3
lines changed

1 file changed

+76
-3
lines changed

examples/oracle/oracle-example-cluster-test.py

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from pycloudlib.oci.instance import OciInstance
1515
from typing import Generator
1616
import logging
17+
import threading
1718

1819
logger = logging.getLogger(__name__)
1920

@@ -112,7 +113,7 @@ def mofed_cluster(self, cluster: list[OciInstance]) -> Generator[list[OciInstanc
112113
subnet_name="private subnet-mofed-vcn", # use the private subnet for mofed testing
113114
)
114115
time.sleep(30) # wait for the secondary vnic to be attached
115-
instance.configure_secondary_vnic(instance)
116+
instance.configure_secondary_vnic()
116117
setup_mofed_iptables_rules(instance)
117118

118119
yield cluster
@@ -140,12 +141,84 @@ def test_rping(
140141
server_instance = mofed_cluster[0]
141142
client_instance = mofed_cluster[1]
142143

143-
# start the rping server on the first instance
144-
server_instance.execute(f"rping -s -a {server_instance.secondary_vnic_private_ip} -v &")
144+
def start_server():
145+
# start the rping server on the first instance
146+
server_instance.execute(f"rping -s -a {server_instance.secondary_vnic_private_ip} -v &")
147+
148+
server_thread = threading.Thread(target=start_server)
149+
server_thread.start()
150+
151+
# Wait for rping server to start
152+
time.sleep(5)
145153
# start the rping client on the second instance (only send 10 packets so it doesn't hang)
146154
r = client_instance.execute(f"rping -c -a {server_instance.secondary_vnic_private_ip} -C 10 -v")
147155
logger.info("rping output: %s", r.stdout)
148156
assert r.ok, "Failed to run rping"
149157

158+
def test_ucmatose(
159+
self,
160+
mofed_cluster: list[OciInstance],
161+
):
162+
server_instance = mofed_cluster[0]
163+
client_instance = mofed_cluster[1]
164+
165+
def start_server():
166+
# start the rping server on the first instance
167+
server_instance.execute(f"ucmatose &")
168+
169+
server_thread = threading.Thread(target=start_server)
170+
server_thread.start()
171+
172+
# Wait for server to start
173+
time.sleep(5)
174+
# start the client on the second instance (only send 10 packets so it doesn't hang)
175+
r = client_instance.execute(f"ucmatose -s {server_instance.secondary_vnic_private_ip}")
176+
logger.info("ucmatose output: %s", r.stdout)
177+
assert r.ok, "Failed to run ucmatose"
178+
179+
def test_ucx_perftest_lat_one_node(
180+
self,
181+
mofed_cluster: list[OciInstance],
182+
):
183+
server_instance = mofed_cluster[0]
184+
# ucx_perftest only works within a single instance on all MOFED stacks right now, so this
185+
# being 0 is intentional. (Will adjust if Oracle provides config info to resolve this)
186+
client_instance = mofed_cluster[0]
187+
188+
def start_server():
189+
# start the rping server on the first instance
190+
server_instance.execute(f"ucx_perftest -c 0 &")
191+
192+
server_thread = threading.Thread(target=start_server)
193+
server_thread.start()
150194

195+
# Wait for server to start
196+
time.sleep(5)
197+
# start the client on the second instance (only send 10 packets so it doesn't hang)
198+
r = client_instance.execute(f"ucx_perftest {server_instance.secondary_vnic_private_ip} -t tag_lat -c 1")
199+
logger.info("ucx_perftest output: %s", r.stdout)
200+
assert r.ok, "Failed to run ucx_perftest"
151201

202+
203+
def test_ucx_perftest_bw_one_node(
204+
self,
205+
mofed_cluster: list[OciInstance],
206+
):
207+
server_instance = mofed_cluster[0]
208+
# ucx_perftest only works within a single instance on all MOFED stacks right now, so this
209+
# being 0 is intentional. (Will adjust if Oracle provides config info to resolve this)
210+
client_instance = mofed_cluster[0]
211+
212+
def start_server():
213+
# start the rping server on the first instance
214+
server_instance.execute(f"ucx_perftest -c 0 &")
215+
216+
server_thread = threading.Thread(target=start_server)
217+
server_thread.start()
218+
219+
# Wait for server to start
220+
time.sleep(5)
221+
# start the client on the second instance (only send 10 packets so it doesn't hang)
222+
r = client_instance.execute(f"ucx_perftest {server_instance.secondary_vnic_private_ip} -t tag_bw -c 1")
223+
logger.info("ucx_perftest output: %s", r.stdout)
224+
assert r.ok, "Failed to run ucx_perftest"

0 commit comments

Comments
 (0)