diff options
author | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-02-17 16:28:17 +0000 |
---|---|---|
committer | astokes <astokes@ef72aa8b-4018-0410-8976-d6e080ef94d8> | 2010-02-17 16:28:17 +0000 |
commit | 18191c43943661b2d61b191ea95a9c9351bd465c (patch) | |
tree | dd426874c830ec029dbd44eec4e469131d4fadc9 /test/commons.py | |
parent | 494f1de1db6c29a3f5f6d0e5cabc29b86eaf99e8 (diff) | |
download | sos-18191c43943661b2d61b191ea95a9c9351bd465c.tar.gz |
- moved 1.9 to trunkr1.9
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@778 ef72aa8b-4018-0410-8976-d6e080ef94d8
Diffstat (limited to 'test/commons.py')
-rw-r--r-- | test/commons.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/commons.py b/test/commons.py new file mode 100644 index 00000000..de2906fd --- /dev/null +++ b/test/commons.py @@ -0,0 +1,32 @@ +# commons.py +import sys, os + +commons = {} +commons['bin'] = '/usr/sbin/sosreport' +commons['fnameRe'] = '/tmp/sosreport-*.xz' +commons['testName'] = 'tester' +commons['testID'] = 1 +commons['batch'] = True +commons['i18n'] = 'en_US.UTF-8' +commons['pluginpath'] = None +commons['plugins'] = [] +commons['testOptions'] = ['--build','--batch'] +if os.path.isfile('/etc/fedora-release'): + commons['distro'] = 'Fedora' +else: + commons['distro'] = 'RHEL' + +paths = sys.path +for path in paths: + if path.strip()[-len("site-packages"):] == "site-packages" \ + and os.path.isdir(path + "/sos/plugins"): + commons['pluginpath'] = path + "/sos/plugins" + +for plugin in os.listdir(commons['pluginpath']): + plugbase = plugin[:-3] + if not plugin[-3:] == '.py' or plugbase == "__init__": + continue + commons['plugins'].append(plugbase) + +def desc(txt): + sys.stdout.write(txt) |