From 90c5c78813a8be664919c4d8f7dde55c4d63cab9 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 10 Jan 2017 22:56:17 +0100 Subject: [PATCH] Add option --no-setuid to supybot-test https://bugs.debian.org/834950 --- plugins/Unix/test.py | 6 ++++-- scripts/supybot-test | 5 +++++ src/test.py | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/Unix/test.py b/plugins/Unix/test.py index 029ed285e..67e981d75 100644 --- a/plugins/Unix/test.py +++ b/plugins/Unix/test.py @@ -48,9 +48,11 @@ else: 'aspell/ispell not available.') skipUnlessFortune = skipIf(utils.findBinaryInPath('fortune') is None, 'fortune not available.') - skipUnlessPing = skipIf(utils.findBinaryInPath('ping') is None, + skipUnlessPing = skipIf( + utils.findBinaryInPath('ping') is None or not setuid, 'ping not available.') - skipUnlessPing6 = skipIf(utils.findBinaryInPath('ping6') is None, + skipUnlessPing6 = skipIf( + utils.findBinaryInPath('ping6') is None or not setuid, 'ping6 not available.') class UnixConfigTestCase(ChannelPluginTestCase): diff --git a/scripts/supybot-test b/scripts/supybot-test index 2f561fa07..518d006db 100644 --- a/scripts/supybot-test +++ b/scripts/supybot-test @@ -138,6 +138,9 @@ if __name__ == '__main__': parser.add_option('', '--no-network', action='store_true', default=False, dest='nonetwork', help='Causes the network-based tests ' 'not to run.') + parser.add_option('', '--no-setuid', action='store_true', default=False, + dest='nosetuid', help='Causes the tests based on a ' + 'setuid executable not to run.') parser.add_option('', '--trace', action='store_true', default=False, help='Traces all calls made. Unless you\'re really in ' 'a pinch, you probably shouldn\'t do this; it results ' @@ -184,6 +187,8 @@ if __name__ == '__main__': if options.nonetwork: test.network = False + if options.nosetuid: + test.setuid = False log.testing = True world.testing = True diff --git a/src/test.py b/src/test.py index b52c166b9..95f512cb3 100644 --- a/src/test.py +++ b/src/test.py @@ -59,6 +59,7 @@ class verbosity: i18n.import_conf() network = True +setuid = True # This is the global list of suites that are to be run. suites = []