(self)
| 393 | self.container_id_list = sn_get_container_info(self.remote_ssh) |
| 394 | |
| 395 | def run(self): |
| 396 | ping_threads = [] |
| 397 | perf_threads = [] |
| 398 | timeptr = 2 # current emulating time |
| 399 | topo_change_file_path = self.configuration_file_path + "/" + self.file_path + '/Topo_leo_change.txt' |
| 400 | fi = open(topo_change_file_path, 'r') |
| 401 | line = fi.readline() |
| 402 | while line: # starting reading change information and emulating |
| 403 | words = line.split() |
| 404 | if words[0] == 'time': |
| 405 | print('Emulation in No.' + str(timeptr) + ' second.') |
| 406 | # the time when the new change occurrs |
| 407 | current_time = str(int(words[1][:-1])) |
| 408 | while int(current_time) > timeptr: |
| 409 | start_time = time.time() |
| 410 | if timeptr in self.utility_checking_time: |
| 411 | sn_check_utility( |
| 412 | timeptr, self.remote_ssh, |
| 413 | self.configuration_file_path + "/" + |
| 414 | self.file_path) |
| 415 | if timeptr % self.update_interval == 0: |
| 416 | # updating link delays after link changes |
| 417 | sn_update_delay(self.file_path, |
| 418 | self.configuration_file_path, timeptr, |
| 419 | self.constellation_size, |
| 420 | self.remote_ssh, self.remote_ftp) |
| 421 | if timeptr in self.damage_time: |
| 422 | sn_damage( |
| 423 | self.damage_ratio[self.damage_time.index(timeptr)], |
| 424 | self.damage_list, self.constellation_size, |
| 425 | self.remote_ssh, self.remote_ftp, self.file_path, |
| 426 | self.configuration_file_path) |
| 427 | if timeptr in self.recovery_time: |
| 428 | sn_recover(self.damage_list, self.sat_loss, |
| 429 | self.remote_ssh, self.remote_ftp, |
| 430 | self.file_path, |
| 431 | self.configuration_file_path) |
| 432 | if timeptr in self.sr_time: |
| 433 | index = [ |
| 434 | i for i, val in enumerate(self.sr_time) |
| 435 | if val == timeptr |
| 436 | ] |
| 437 | for index_num in index: |
| 438 | sn_sr(self.sr_src[index_num], |
| 439 | self.sr_des[index_num], |
| 440 | self.sr_target[index_num], |
| 441 | self.container_id_list, self.remote_ssh) |
| 442 | if timeptr in self.ping_time: |
| 443 | if timeptr in self.ping_time: |
| 444 | index = [ |
| 445 | i for i, val in enumerate(self.ping_time) |
| 446 | if val == timeptr |
| 447 | ] |
| 448 | for index_num in index: |
| 449 | ping_thread = threading.Thread( |
| 450 | target=sn_ping, |
| 451 | args=(self.ping_src[index_num], |
| 452 | self.ping_des[index_num], |
nothing calls this directly
no test coverage detected