| 1 |
# Copyright (C) 2008, 2010, 2014 Red Hat Inc. |
| 2 |
# |
| 3 |
# This file is part of systemtap, and is free software. You can |
| 4 |
# redistribute it and/or modify it under the terms of the GNU General |
| 5 |
# Public License (GPL); either version 2, or (at your option) any |
| 6 |
# later version. |
| 7 |
|
| 8 |
import os |
| 9 |
import sys |
| 10 |
|
| 11 |
# Here we set up the default config options. These can be overridden |
| 12 |
# by the config file. |
| 13 |
config_opts = dict() |
| 14 |
|
| 15 |
# |
| 16 |
# Various file names |
| 17 |
# |
| 18 |
|
| 19 |
# PROBES_ALL is the file that contains the full list of kernel |
| 20 |
# functions to test. If it doesn't exist, it can be created by |
| 21 |
# readelf.py with a list of all kernel functions. |
| 22 |
config_opts['probes_all'] = 'probes.all' |
| 23 |
|
| 24 |
# PROBES_UNREGISTERED is a file that contains the list of kernel |
| 25 |
# functions where a probe couldn't be registered. |
| 26 |
config_opts['probes_unregistered'] = 'probes.unregistered' |
| 27 |
|
| 28 |
# PROBES_UNTRIGGERED is a file that contains the list of kernel |
| 29 |
# functions where a probe could be registered, but the kernel |
| 30 |
# function wasn't actually called. So, we don't really know whether |
| 31 |
# these functions passed or failed. |
| 32 |
config_opts['probes_untriggered'] = 'probes.untriggered' |
| 33 |
|
| 34 |
# PROBES_PASSED is a file that contains the list of kernel functions |
| 35 |
# where a probe was registered and the kerenel function was called |
| 36 |
# with no crash. |
| 37 |
config_opts['probes_passed'] = 'probes.passed' |
| 38 |
|
| 39 |
# PROBES_FAILED is a file that contains the list of kernel functions |
| 40 |
# where a probe was registered and the kernel function was called |
| 41 |
# that caused a crash. |
| 42 |
config_opts['probes_failed'] = 'probes.failed' |
| 43 |
|
| 44 |
# PROBES_CURRENT is a file that contains the list of kernel functions |
| 45 |
# we're about to test. |
| 46 |
config_opts['probes_current'] = 'probes.current' |
| 47 |
|
| 48 |
# PROBES_RESULT is a file that contains the results of the current |
| 49 |
# test. |
| 50 |
config_opts['probes_result'] = 'probe.out' |
| 51 |
|
| 52 |
# PROBES_DB is a file that contains the current state (in python |
| 53 |
# 'pickled' format). |
| 54 |
config_opts['probes_db'] = 'probes.db' |
| 55 |
|
| 56 |
# LOG_FILE is the file that contains the testing log output. |
| 57 |
config_opts['log_file'] = 'kprobes_test.log' |
| 58 |
|
| 59 |
# RCLOCAL is the file we need to edit to get the test to automatically |
| 60 |
# run after a reboot. |
| 61 |
config_opts['rclocal'] = '/etc/rc.d/rc.local' |
| 62 |
|
| 63 |
# Read in the config file |
| 64 |
print "Reading config file..." |
| 65 |
cfg = os.path.join(os.getcwd(), 'default.cfg') |
| 66 |
if os.path.exists(cfg): |
| 67 |
execfile(cfg) |
| 68 |
else: |
| 69 |
print >>sys.stderr, ("Could not find required config file: %s" % cfg) |
| 70 |
sys.exit(1) |