diff options
| author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-09-19 13:18:06 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-09-22 12:19:41 +0100 |
| commit | d6529876129a6932b6d2e369b3fd6ca40d342add (patch) | |
| tree | 82b62115b0f4ba9701c823988472884c735872b7 /scripts/qemuimage-testlib-pythonhelper | |
| parent | 595321a62669e90bed5f459a9d926a68988086a9 (diff) | |
| download | poky-d6529876129a6932b6d2e369b3fd6ca40d342add.tar.gz | |
classes/imagetest-qemu: remove old image testing class
This has now been superseded by testimage.
(From OE-Core rev: d469c92394a1a95ae7a45b8b80dc4c2918e0e9a6)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/qemuimage-testlib-pythonhelper')
| -rwxr-xr-x | scripts/qemuimage-testlib-pythonhelper | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/scripts/qemuimage-testlib-pythonhelper b/scripts/qemuimage-testlib-pythonhelper deleted file mode 100755 index 6435dd8f18..0000000000 --- a/scripts/qemuimage-testlib-pythonhelper +++ /dev/null | |||
| @@ -1,66 +0,0 @@ | |||
| 1 | #!/usr/bin/env python | ||
| 2 | |||
| 3 | import optparse | ||
| 4 | import subprocess | ||
| 5 | import sys | ||
| 6 | import os | ||
| 7 | |||
| 8 | parser = optparse.OptionParser( | ||
| 9 | usage = """ | ||
| 10 | %prog [options] | ||
| 11 | """) | ||
| 12 | |||
| 13 | parser.add_option("-q", "--findqemu", | ||
| 14 | help = "find a qemu beneath the process <pid>", | ||
| 15 | action="store", dest="findqemu") | ||
| 16 | |||
| 17 | options, args = parser.parse_args(sys.argv) | ||
| 18 | |||
| 19 | if options.findqemu: | ||
| 20 | # | ||
| 21 | # Walk the process tree from the process specified looking for a qemu-system. Return its pid. | ||
| 22 | # | ||
| 23 | ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,command'], stdout=subprocess.PIPE).communicate()[0] | ||
| 24 | processes = ps.split('\n') | ||
| 25 | nfields = len(processes[0].split()) - 1 | ||
| 26 | pids = {} | ||
| 27 | commands = {} | ||
| 28 | for row in processes[1:]: | ||
| 29 | data = row.split(None, nfields) | ||
| 30 | if len(data) != 3: | ||
| 31 | continue | ||
| 32 | if data[1] not in pids: | ||
| 33 | pids[data[1]] = [] | ||
| 34 | pids[data[1]].append(data[0]) | ||
| 35 | commands[data[0]] = data[2] | ||
| 36 | |||
| 37 | if options.findqemu not in pids: | ||
| 38 | sys.stderr.write("No children found matching %s" % options.findqemu) | ||
| 39 | sys.exit(1) | ||
| 40 | |||
| 41 | parents = [] | ||
| 42 | newparents = pids[options.findqemu] | ||
| 43 | while newparents: | ||
| 44 | next = [] | ||
| 45 | for p in newparents: | ||
| 46 | if p in pids: | ||
| 47 | for n in pids[p]: | ||
| 48 | if n not in parents and n not in next: | ||
| 49 | next.append(n) | ||
| 50 | |||
| 51 | if p not in parents: | ||
| 52 | parents.append(p) | ||
| 53 | newparents = next | ||
| 54 | #print "Children matching %s:" % str(parents) | ||
| 55 | for p in parents: | ||
| 56 | # Need to be careful here since runqemu-internal runs "ldd qemu-system-xxxx" | ||
| 57 | # Also, old versions of ldd (2.11) run "LD_XXXX qemu-system-xxxx" | ||
| 58 | basecmd = commands[p].split()[0] | ||
| 59 | basecmd = os.path.basename(basecmd) | ||
| 60 | if "qemu-system" in basecmd and "192.168" in commands[p]: | ||
| 61 | print p | ||
| 62 | sys.exit(0) | ||
| 63 | sys.exit(1) | ||
| 64 | else: | ||
| 65 | parser.print_help() | ||
| 66 | |||
