MCPcopy Create free account
hub / github.com/SpaceNetLab/StarryNet / sn_damage_link

Function sn_damage_link

starrynet/sn_orchestrater.py:418–430  ·  view source on GitHub ↗
(sat_index, container_id_list)

Source from the content-addressed store, hash-verified

416
417
418def sn_damage_link(sat_index, container_id_list):
419 with os.popen(
420 "docker exec -it " + str(container_id_list[sat_index]) +
421 " ifconfig | sed 's/[ \t].*//;/^\(eth0\|\)\(lo\|\)$/d'") as f:
422 ifconfig_output = f.readlines()
423 for intreface in range(0, len(ifconfig_output), 2):
424 os.system("docker exec -d " + str(container_id_list[sat_index]) +
425 " tc qdisc change dev " +
426 ifconfig_output[intreface][:-1] +
427 " root netem loss 100%")
428 print("docker exec -d " + str(container_id_list[sat_index]) +
429 " tc qdisc change dev " + ifconfig_output[intreface][:-1] +
430 " root netem loss 100%")
431
432
433def sn_damage(random_list, container_id_list):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected