]> git.proxmox.com Git - pve-container.git/commitdiff
Add setup tests for authorized keys
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 5 Apr 2016 11:17:01 +0000 (13:17 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 5 Apr 2016 13:27:17 +0000 (15:27 +0200)
include ssh keys in previous test cases, add one extra test
case for a non-default $HOME read from /etc/passwd

27 files changed:
src/test/run_setup_tests.pl
src/test/test-centos6-001/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-001/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-002/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-003/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-004/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-005/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-006/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-007/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-008/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-009/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-010/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-011/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-012/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-013/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-debian-014/config [new file with mode: 0644]
src/test/test-debian-014/etc/debian_version [new file with mode: 0644]
src/test/test-debian-014/etc/hostname.exp [new file with mode: 0644]
src/test/test-debian-014/etc/hosts.exp [new file with mode: 0644]
src/test/test-debian-014/etc/passwd [new file with mode: 0644]
src/test/test-debian-014/etc/passwd.exp [new file with mode: 0644]
src/test/test-debian-014/etc/shadow [new file with mode: 0644]
src/test/test-debian-014/etc/shadow.exp [new file with mode: 0644]
src/test/test-debian-014/roothome/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-opensuse-001/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-opensuse-002/root/.ssh/authorized_keys.exp [new file with mode: 0644]
src/test/test-opensuse-003/root/.ssh/authorized_keys.exp [new file with mode: 0644]

index 82148382dcdb1b99ac4070ce1e051b82b1bbf739..fc92dbb10e1ef80d5ec6fee88a3bf2a3dcd2d717 100755 (executable)
@@ -41,7 +41,7 @@ sub run_test {
        # run tests twice, to make sure scripts are idempotent
        
        srand(0);
-       $lxc_setup->post_create_hook('$TEST$ABCDEF');
+       $lxc_setup->post_create_hook('$TEST$ABCDEF','ssh-rsa ABCDEFG ABC@DEF');
 
        my @testfiles = qw(/etc/hostname
                           /etc/hosts
@@ -71,7 +71,13 @@ sub run_test {
                           /etc/init/tty.conf
                           /etc/init/power-status-changed.conf
                           /etc/securetty
-                          /etc/crontab);
+                          /etc/crontab
+                          /root
+                          /root/.ssh
+                          /root/.ssh/authorized_keys
+                          /roothome
+                          /roothome/.ssh
+                          /roothome/.ssh/authorized_keys);
        foreach my $fn (@testfiles) {
            next if !-f "$testdir/$fn.exp";
            test_file("$testdir/$fn.exp", "$rootfs/$fn");
diff --git a/src/test/test-centos6-001/root/.ssh/authorized_keys.exp b/src/test/test-centos6-001/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-001/root/.ssh/authorized_keys.exp b/src/test/test-debian-001/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-002/root/.ssh/authorized_keys.exp b/src/test/test-debian-002/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-003/root/.ssh/authorized_keys.exp b/src/test/test-debian-003/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-004/root/.ssh/authorized_keys.exp b/src/test/test-debian-004/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-005/root/.ssh/authorized_keys.exp b/src/test/test-debian-005/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-006/root/.ssh/authorized_keys.exp b/src/test/test-debian-006/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-007/root/.ssh/authorized_keys.exp b/src/test/test-debian-007/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-008/root/.ssh/authorized_keys.exp b/src/test/test-debian-008/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-009/root/.ssh/authorized_keys.exp b/src/test/test-debian-009/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-010/root/.ssh/authorized_keys.exp b/src/test/test-debian-010/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-011/root/.ssh/authorized_keys.exp b/src/test/test-debian-011/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-012/root/.ssh/authorized_keys.exp b/src/test/test-debian-012/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-013/root/.ssh/authorized_keys.exp b/src/test/test-debian-013/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-debian-014/config b/src/test/test-debian-014/config
new file mode 100644 (file)
index 0000000..8f09fd8
--- /dev/null
@@ -0,0 +1 @@
+hostname: test9
diff --git a/src/test/test-debian-014/etc/debian_version b/src/test/test-debian-014/etc/debian_version
new file mode 100644 (file)
index 0000000..4fedf1d
--- /dev/null
@@ -0,0 +1 @@
+7.0
diff --git a/src/test/test-debian-014/etc/hostname.exp b/src/test/test-debian-014/etc/hostname.exp
new file mode 100644 (file)
index 0000000..c372db4
--- /dev/null
@@ -0,0 +1 @@
+test9
diff --git a/src/test/test-debian-014/etc/hosts.exp b/src/test/test-debian-014/etc/hosts.exp
new file mode 100644 (file)
index 0000000..ac7ee16
--- /dev/null
@@ -0,0 +1,5 @@
+# --- BEGIN PVE ---
+127.0.0.1 localhost.localnet localhost
+::1 localhost.localnet localhost
+127.0.1.1 test9
+# --- END PVE ---
diff --git a/src/test/test-debian-014/etc/passwd b/src/test/test-debian-014/etc/passwd
new file mode 100644 (file)
index 0000000..9fc110f
--- /dev/null
@@ -0,0 +1,21 @@
+root:x:0:0:root:/roothome:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+libuuid:x:100:101::/var/lib/libuuid:/bin/sh
+postfix:x:101:104::/var/spool/postfix:/bin/false
+sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
diff --git a/src/test/test-debian-014/etc/passwd.exp b/src/test/test-debian-014/etc/passwd.exp
new file mode 100644 (file)
index 0000000..9fc110f
--- /dev/null
@@ -0,0 +1,21 @@
+root:x:0:0:root:/roothome:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/bin/sh
+bin:x:2:2:bin:/bin:/bin/sh
+sys:x:3:3:sys:/dev:/bin/sh
+sync:x:4:65534:sync:/bin:/bin/sync
+games:x:5:60:games:/usr/games:/bin/sh
+man:x:6:12:man:/var/cache/man:/bin/sh
+lp:x:7:7:lp:/var/spool/lpd:/bin/sh
+mail:x:8:8:mail:/var/mail:/bin/sh
+news:x:9:9:news:/var/spool/news:/bin/sh
+uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
+proxy:x:13:13:proxy:/bin:/bin/sh
+www-data:x:33:33:www-data:/var/www:/bin/sh
+backup:x:34:34:backup:/var/backups:/bin/sh
+list:x:38:38:Mailing List Manager:/var/list:/bin/sh
+irc:x:39:39:ircd:/var/run/ircd:/bin/sh
+gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
+nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
+libuuid:x:100:101::/var/lib/libuuid:/bin/sh
+postfix:x:101:104::/var/spool/postfix:/bin/false
+sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin
diff --git a/src/test/test-debian-014/etc/shadow b/src/test/test-debian-014/etc/shadow
new file mode 100644 (file)
index 0000000..7d4be16
--- /dev/null
@@ -0,0 +1,21 @@
+root:!*:15908:0:99999:7:::
+daemon:*:15908:0:99999:7:::
+bin:*:15908:0:99999:7:::
+sys:*:15908:0:99999:7:::
+sync:*:15908:0:99999:7:::
+games:*:15908:0:99999:7:::
+man:*:15908:0:99999:7:::
+lp:*:15908:0:99999:7:::
+mail:*:15908:0:99999:7:::
+news:*:15908:0:99999:7:::
+uucp:*:15908:0:99999:7:::
+proxy:*:15908:0:99999:7:::
+www-data:*:15908:0:99999:7:::
+backup:*:15908:0:99999:7:::
+list:*:15908:0:99999:7:::
+irc:*:15908:0:99999:7:::
+gnats:*:15908:0:99999:7:::
+nobody:*:15908:0:99999:7:::
+libuuid:!:15908:0:99999:7:::
+postfix:*:15908:0:99999:7:::
+sshd:*:15908:0:99999:7:::
diff --git a/src/test/test-debian-014/etc/shadow.exp b/src/test/test-debian-014/etc/shadow.exp
new file mode 100644 (file)
index 0000000..deb9e2d
--- /dev/null
@@ -0,0 +1,21 @@
+root:$TEST$ABCDEF:12345:0:99999:7:::
+daemon:*:15908:0:99999:7:::
+bin:*:15908:0:99999:7:::
+sys:*:15908:0:99999:7:::
+sync:*:15908:0:99999:7:::
+games:*:15908:0:99999:7:::
+man:*:15908:0:99999:7:::
+lp:*:15908:0:99999:7:::
+mail:*:15908:0:99999:7:::
+news:*:15908:0:99999:7:::
+uucp:*:15908:0:99999:7:::
+proxy:*:15908:0:99999:7:::
+www-data:*:15908:0:99999:7:::
+backup:*:15908:0:99999:7:::
+list:*:15908:0:99999:7:::
+irc:*:15908:0:99999:7:::
+gnats:*:15908:0:99999:7:::
+nobody:*:15908:0:99999:7:::
+libuuid:!:15908:0:99999:7:::
+postfix:*:15908:0:99999:7:::
+sshd:*:15908:0:99999:7:::
diff --git a/src/test/test-debian-014/roothome/.ssh/authorized_keys.exp b/src/test/test-debian-014/roothome/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-opensuse-001/root/.ssh/authorized_keys.exp b/src/test/test-opensuse-001/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-opensuse-002/root/.ssh/authorized_keys.exp b/src/test/test-opensuse-002/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---
diff --git a/src/test/test-opensuse-003/root/.ssh/authorized_keys.exp b/src/test/test-opensuse-003/root/.ssh/authorized_keys.exp
new file mode 100644 (file)
index 0000000..1cb3ec3
--- /dev/null
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC@DEF
+# --- END PVE ---