diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-06-05 19:53:06 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-06-05 19:53:06 +0100 |
commit | ab3efb66888bf10938c8ec312240ffd3984a7e46 (patch) | |
tree | 7a35e1ac272e20558aceb129add771e3dcd9fe0a /systest | |
parent | eb4f41cea26612d9161fa1094ad0a0b7c411e64d (diff) | |
download | systest-ab3efb66888bf10938c8ec312240ffd3984a7e46.tar.gz |
Add --list-test and simplify test names.
Diffstat (limited to 'systest')
-rwxr-xr-x | systest | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -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') |