mbligh | c6b01ed | 2006-10-13 17:03:26 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
mbligh | 4983e60 | 2006-05-18 18:27:31 +0000 | [diff] [blame] | 2 | import os,os.path,shutil |
| 3 | from autotest_utils import * |
| 4 | |
| 5 | files = ['/proc/pci', '/proc/meminfo', '/proc/slabinfo', '/proc/version', |
| 6 | '/proc/cpuinfo'] |
mbligh | 8a5a611 | 2006-06-02 00:18:59 +0000 | [diff] [blame] | 7 | commands = ['lshw', 'uname -a', 'lspci -vvn'] |
mbligh | 4983e60 | 2006-05-18 18:27:31 +0000 | [diff] [blame] | 8 | path = ['/usr/bin', '/bin'] |
| 9 | |
| 10 | def run_command(command, output): |
| 11 | for dir in path: |
| 12 | pathname = dir + '/' + command |
| 13 | if (os.path.exists(pathname)): |
| 14 | system(pathname + ' > ' + output) |
| 15 | |
| 16 | for command in commands: |
| 17 | run_command(command, os.path.basename(command)) |
| 18 | |
| 19 | for file in files: |
mbligh | 72a6d96 | 2006-05-24 18:46:56 +0000 | [diff] [blame] | 20 | if (os.path.exists(file)): |
| 21 | shutil.copyfile(file, os.path.basename(file)) |
mbligh | 4983e60 | 2006-05-18 18:27:31 +0000 | [diff] [blame] | 22 | |