Configured for jouya
This commit is contained in:
1 parent
015a142735
commit
8a87db81c1
5 files changed
+18
-18
No files matched your search
+6
-6
@@ -290,25 +290,25 @@ Total matches: 100
|
||||
#generate log files on all the machines before running this test
|
||||
print("Generating log files on all machines...")
|
||||
for i, ip in enumerate(ALL_IPS):
|
||||
subprocess.run(["ssh", f"asing271@{ip}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && python3 generate_log.py {i + 1} 100"])
|
||||
subprocess.run(["ssh", f"vm{i + 1}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && python3 generate_log.py {i + 1} 100"])
|
||||
|
||||
#start the server on all the machines before running this test
|
||||
print("Starting server on all machines...")
|
||||
for i, ip in enumerate(ALL_IPS):
|
||||
print(f"Starting server on machine {i + 1} ({ip})...")
|
||||
subprocess.run(["ssh", f"asing271@{ip}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && setsid -f python3 server.py > server.log 2>&1 < /dev/null"])
|
||||
subprocess.run(["ssh", f"vm{i + 1}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && setsid -f python3 server.py > server.log 2>&1 < /dev/null"])
|
||||
|
||||
#ssh into one machine at randome
|
||||
machine_num = random.randint(1, len(ALL_IPS))
|
||||
print(f"Running grep command on a {machine_num} random machine...")
|
||||
for i in tests:
|
||||
result = subprocess.run(["ssh", f"asing271@{ALL_IPS[machine_num - 1]}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && grepp {i} -t"], capture_output=True, text=True)
|
||||
result = subprocess.run(["ssh", f"vm{machine_num}", f"cd ~/fa26_cs425_.group-mp_.team-01/MP1 && grepp {i} -t"], capture_output=True, text=True)
|
||||
if result.stdout.strip() == results[tests.index(i)].strip():
|
||||
print("PASS {i} test")
|
||||
print(f"PASS {i} test")
|
||||
else:
|
||||
print("FAIL {i} test")
|
||||
print(f"FAIL {i} test")
|
||||
|
||||
#delete log files on all the machines after running this test
|
||||
print("Deleting log files on all machines...")
|
||||
for i, ip in enumerate(ALL_IPS):
|
||||
subprocess.run(["ssh", f"asing271@{ip}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && rm -f ./machine.*.test.log"])
|
||||
subprocess.run(["ssh", f"vm{i + 1}", "cd ~/fa26_cs425_.group-mp_.team-01/MP1 && rm -f ./machine.*.test.log"])
|
||||
Reference in new issue
Block a user