| 468 | |
| 469 | |
| 470 | def sn_stop_emulation(): |
| 471 | os.system("docker service rm constellation-test") |
| 472 | with os.popen("docker rm -f $(docker ps -a -q)") as f: |
| 473 | f.readlines() |
| 474 | with os.popen("docker network ls") as f: |
| 475 | all_br_info = f.readlines() |
| 476 | del_threads = [] |
| 477 | for line in all_br_info: |
| 478 | if "La" in line or "Le" or "GS" in line: |
| 479 | network_name = line.split()[1] |
| 480 | del_thread = threading.Thread(target=sn_del_network, |
| 481 | args=(network_name, )) |
| 482 | del_threads.append(del_thread) |
| 483 | for del_thread in del_threads: |
| 484 | del_thread.start() |
| 485 | for del_thread in del_threads: |
| 486 | del_thread.join() |
| 487 | |
| 488 | |
| 489 | def sn_recover(damage_list, container_id_list, sat_loss): |