summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
888af5e)
This should be workaround before actual fix is done.
JIRA: DOCTOR-123
Change-Id: I70fd4ed9d2aa2cc3a6c46e2515062b7acd31ca0a
Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com>
import os
from os.path import isfile, join
import random
import os
from os.path import isfile, join
import random
num = random.randint(0, self.conf.instance_count - 1)
vm_name = "%s%d" % (self.conf.instance_basename, num)
num = random.randint(0, self.conf.instance_count - 1)
vm_name = "%s%d" % (self.conf.instance_basename, num)
- servers = \
- {getattr(server, 'name'): server
- for server in self.nova.servers.list()}
+ servers = {getattr(server, 'name'): server
+ for server in self.nova.servers.list()}
server = servers.get(vm_name)
if not server:
server = servers.get(vm_name)
if not server:
- raise \
- Exception('Can not find instance: vm_name(%s)' % vm_name)
+ raise Exception('Can not find instance: vm_name(%s)' % vm_name)
host_name = server.__dict__.get('OS-EXT-SRV-ATTR:hypervisor_hostname')
host_ip = self.installer.get_host_ip_from_hostname(host_name)
host_name = server.__dict__.get('OS-EXT-SRV-ATTR:hypervisor_hostname')
host_ip = self.installer.get_host_ip_from_hostname(host_name)
# TODO(yujunz) check the actual delay to verify time sync status
# expected ~1s delay from $trigger to $linkdown
relative_start = linkdown
# TODO(yujunz) check the actual delay to verify time sync status
# expected ~1s delay from $trigger to $linkdown
relative_start = linkdown
- os.environ['DOCTOR_PROFILER_T00'] = \
- str(int((linkdown - relative_start) * 1000))
- os.environ['DOCTOR_PROFILER_T01'] = \
- str(int((detected - relative_start) * 1000))
- os.environ['DOCTOR_PROFILER_T03'] = \
- str(int((vmdown - relative_start) * 1000))
- os.environ['DOCTOR_PROFILER_T04'] = \
- str(int((hostdown - relative_start) * 1000))
- os.environ['DOCTOR_PROFILER_T09'] = \
- str(int((notified - relative_start) * 1000))
+ os.environ['DOCTOR_PROFILER_T00'] = (
+ str(int((linkdown - relative_start) * 1000)))
+ os.environ['DOCTOR_PROFILER_T01'] = (
+ str(int((detected - relative_start) * 1000)))
+ os.environ['DOCTOR_PROFILER_T03'] = (
+ str(int((vmdown - relative_start) * 1000)))
+ os.environ['DOCTOR_PROFILER_T04'] = (
+ str(int((hostdown - relative_start) * 1000)))
+ os.environ['DOCTOR_PROFILER_T09'] = (
+ str(int((notified - relative_start) * 1000)))
self.installer.cleanup()
self.image.delete()
self.user.delete()
self.installer.cleanup()
self.image.delete()
self.user.delete()
+ # Kill possible hanging subprocess
+ os.killpg(0, signal.SIGKILL)
def main():
"""doctor main"""
def main():
"""doctor main"""
+ # TODO (tojuvone): JIRA DOCTOR-123: Test cases have some issue to always
+ # kill all subprocesses. To ensure they are killed this group is done so
+ # all processes can be killed without knowing what they are.
+ os.setpgrp()
test_dir = os.path.split(os.path.realpath(__file__))[0]
doctor_root_dir = os.path.dirname(test_dir)
test_dir = os.path.split(os.path.realpath(__file__))[0]
doctor_root_dir = os.path.dirname(test_dir)