From ab3efb66888bf10938c8ec312240ffd3984a7e46 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 5 Jun 2011 19:53:06 +0100 Subject: Add --list-test and simplify test names. --- systest | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'systest') diff --git a/systest b/systest index bab5e34..5055b62 100755 --- a/systest +++ b/systest @@ -22,9 +22,13 @@ class SystemTest(cliapp.Application): self.settings.string(['target'], 'target domain name or IP address') self.settings.string(['user'], 'user on target') self.settings.string(['user-password'], 'password for target user') + self.settings.boolean(['list-tests'], 'list known tests') def process_args(self, args): - if args: + if self.settings['list-tests']: + for testname in self.list_tests(): + self.output.write('%s\n' % testname) + elif args: self.execute_tests(args) else: self.execute_tests(self.list_tests()) @@ -87,29 +91,29 @@ class SystemTest(cliapp.Application): automsg='pattern %s does not match %s' % (pat, text), msg=msg) - def test_only_listens_on_ssh_port_externally(self): + def test_only_ssh_port(self): out = self.hostcmd(['nmap', self.settings['target']]) ports = [line.split()[0] for line in out.splitlines() if ' open ' in line] self.assertEqual(ports, ['22/tcp']) - def test_ssh_login_works(self): + def test_ssh_login(self): user = self.settings['user'] out = self.hostcmd(['ssh', '-l', user, self.settings['target'], 'id']) self.assertMatches(r'^uid=1000\(%s\)' % user, out) - def test_manages_at_least_one_dns_lookup(self): + def test_simple_dns_lookup(self): out = self.targetcmd(['host', 'www.debian.org']) self.assert_('www.debian.org' in out) - def test_pings_localhost(self): + def test_ping_localhost(self): self.targetcmd(['ping', '-c1', 'localhost']) - def test_ping_localhost_using_ipv6(self): + def test_ping6_localhost(self): self.targetcmd(['ping6', '-c1', 'ip6-localhost']) - def test_cat_works(self): + def test_cat(self): out = self.targetcmd(['cat'], stdin='foo') self.assertEqual(out, 'foo') -- cgit v1.2.1