summaryrefslogtreecommitdiffstats
path: root/tests/py
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2016-11-17 17:43:11 +0100
committerFlorian Westphal <fw@strlen.de>2016-11-17 23:17:06 +0100
commit8e0716e93e206f949912b2507cc5c0b91999dbce (patch)
treeb2e7102c891477ded9cf5446f5b70a528b4092d6 /tests/py
parent493cbf585d8f9a2a79a86e5bbca600ca1ea8ab60 (diff)
Revert "tests: py: nft-tests.py: Add function for loading and removing kernel modules"
Its not needed at the moment, all tests that need a network interface (meta iif/oif) use the lo interface. For iifname/oifname the network device doesn't have to exist. We can revisit this in case we need it in the future. (seems commit causes issues on kernels built without dummy module). Reported-by: Arturo Borrero Gonzalez <arturo@debian.org> Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Manuel Messner <mm@skelett.io>
Diffstat (limited to 'tests/py')
-rwxr-xr-xtests/py/nft-test.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index c1217bbb..fc7ae608 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -28,7 +28,6 @@ table_list = []
chain_list = []
all_set = dict()
signal_received = 0
-modules = []
class Colors:
@@ -115,30 +114,6 @@ def print_differences_error(filename, lineno, cmd):
str(lineno + 1) + ": '" + cmd + "': " + reason
-def cleanup_modules():
- for i in modules:
- modprobe(i, remove=True)
-
-
-def modprobe(name, remove=False):
- '''
- Loads or removes a kernel module
- '''
- if name is None:
- return -1
-
- cmds = {
- 'ins': ['modprobe', '--first-time', '--quiet', name],
- 'del': ['modprobe', '-r', name],
- }
-
- ret = subprocess.call(cmds['del' if remove else 'ins']) == 0
- if ret and not remove:
- # the kernel module has been loaded -> remove it afterwards
- global modules
- modules.append(name)
-
-
def table_exist(table, filename, lineno):
'''
Exists a table.
@@ -711,8 +686,6 @@ def cleanup_on_exit():
set_delete(table)
table_delete(table)
- cleanup_modules()
-
def signal_handler(signal, frame):
global signal_received
@@ -992,8 +965,6 @@ def main():
print "The nft binary does not exist. You need to build the project."
return
- modprobe('dummy')
-
test_files = files_ok = run_total = 0
tests = passed = warnings = errors = 0
global log_file
@@ -1001,7 +972,6 @@ def main():
log_file = open(LOGFILE, 'w')
except IOError:
print "Cannot open log file %s" % LOGFILE
- cleanup_modules()
return
file_list = []
@@ -1050,8 +1020,6 @@ def main():
"%d error, %d warning" \
% (test_files, files_ok, tests, errors, warnings)
- cleanup_modules()
-
if __name__ == '__main__':
main()