summaryrefslogtreecommitdiff
path: root/tests-debian-base-install.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-06-28 20:43:51 +0100
committerLars Wirzenius <liw@liw.fi>2011-06-28 20:43:51 +0100
commit336afecca5427070ce97155fe6341a0514500e92 (patch)
tree36267cf3b51bd86f45dca47214ecf559939ee239 /tests-debian-base-install.py
parent1d6b71ef69a3a26d2649c2856fed423ac8261d21 (diff)
downloadsystest-336afecca5427070ce97155fe6341a0514500e92.tar.gz
Add Debian base system tests.
Diffstat (limited to 'tests-debian-base-install.py')
-rw-r--r--tests-debian-base-install.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests-debian-base-install.py b/tests-debian-base-install.py
new file mode 100644
index 0000000..b2bcfcd
--- /dev/null
+++ b/tests-debian-base-install.py
@@ -0,0 +1,51 @@
+# Copyright 2011 Lars Wirzenius
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+'''Tests for a Debian base install, with openssh-server installed.'''
+
+
+import systest
+
+
+class DebianBasePlusOpenSshServerTests(systest.TestCase):
+
+ def test_only_ssh_port(self):
+ self.assertEqual(self.find_open_ports(), ['22/tcp'])
+
+ def test_ssh_login(self):
+ user = self.settings['user']
+ out = self.targetcmd(['id'])
+ self.assertMatches(r'^uid=\d+\(%s\)' % user, out)
+
+ def test_simple_dns_lookup(self):
+ out = self.targetcmd(['host', 'www.debian.org'])
+ self.assert_('www.debian.org' in out)
+
+ def test_ping_localhost(self):
+ self.targetcmd(['ping', '-c1', 'localhost'])
+
+ def test_ping6_localhost(self):
+ self.targetcmd(['ping6', '-c1', 'ip6-localhost'])
+
+ def test_cat(self):
+ out = self.targetcmd(['cat'], stdin='foo')
+ self.assertEqual(out, 'foo')
+
+ def test_sudo(self):
+ out = self.targetcmd(['sudo', '-S', 'id'],
+ stdin='%s\n' % self.settings['user-password'])
+ self.assertMatches(r'^uid=0\(root\)', out)
+