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

Function sn_delay_change

starrynet/sn_orchestrater.py:527–542  ·  view source on GitHub ↗
(link_x, link_y, delay, container_id_list,
                    constellation_size)

Source from the content-addressed store, hash-verified

525
526
527def sn_delay_change(link_x, link_y, delay, container_id_list,
528 constellation_size): # multi-thread updating delays
529 if link_y <= constellation_size:
530 os.system("docker exec -d " + str(container_id_list[link_x]) +
531 " tc qdisc change dev B" + str(link_x + 1) + "-eth" +
532 str(link_y + 1) + " root netem delay " + str(delay) + "ms")
533 os.system("docker exec -d " + str(container_id_list[link_y]) +
534 " tc qdisc change dev B" + str(link_y + 1) + "-eth" +
535 str(link_x + 1) + " root netem delay " + str(delay) + "ms")
536 else:
537 os.system("docker exec -d " + str(container_id_list[link_x]) +
538 " tc qdisc change dev B" + str(link_x + 1) + "-eth" +
539 str(link_y + 1) + " root netem delay " + str(delay) + "ms")
540 os.system("docker exec -d " + str(container_id_list[link_y]) +
541 " tc qdisc change dev B" + str(link_y + 1) + "-eth" +
542 str(link_x + 1) + " root netem delay " + str(delay) + "ms")
543
544
545if __name__ == '__main__':

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected