[pve-devel] [PATCH container 2/2] tests: add minimal test for LXC_NAME hosts entry

Stoiko Ivanov s.ivanov at proxmox.com
Wed Jun 14 12:43:16 CEST 2023


based on test-alpine-002

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/test/test-alpine-003/config               |  2 ++
 src/test/test-alpine-003/etc/alpine-release   |  1 +
 src/test/test-alpine-003/etc/hostname.exp     |  1 +
 src/test/test-alpine-003/etc/hosts            |  5 +++++
 src/test/test-alpine-003/etc/hosts.exp        |  5 +++++
 .../test-alpine-003/etc/network/interfaces    |  0
 src/test/test-alpine-003/etc/passwd           | 21 +++++++++++++++++++
 .../roothome/.ssh/authorized_keys.exp         |  3 +++
 8 files changed, 38 insertions(+)
 create mode 100644 src/test/test-alpine-003/config
 create mode 100644 src/test/test-alpine-003/etc/alpine-release
 create mode 100644 src/test/test-alpine-003/etc/hostname.exp
 create mode 100644 src/test/test-alpine-003/etc/hosts
 create mode 100644 src/test/test-alpine-003/etc/hosts.exp
 create mode 100644 src/test/test-alpine-003/etc/network/interfaces
 create mode 100644 src/test/test-alpine-003/etc/passwd
 create mode 100644 src/test/test-alpine-003/roothome/.ssh/authorized_keys.exp

diff --git a/src/test/test-alpine-003/config b/src/test/test-alpine-003/config
new file mode 100644
index 0000000..9e8a6b7
--- /dev/null
+++ b/src/test/test-alpine-003/config
@@ -0,0 +1,2 @@
+hostname: test3
+net0: name=eth0,hwaddr=12:22:33:44:55:66,bridge=vmbr0,ip=10.0.0.100/32,gw=11.0.0.1
diff --git a/src/test/test-alpine-003/etc/alpine-release b/src/test/test-alpine-003/etc/alpine-release
new file mode 100644
index 0000000..c10780c
--- /dev/null
+++ b/src/test/test-alpine-003/etc/alpine-release
@@ -0,0 +1 @@
+3.13.1
diff --git a/src/test/test-alpine-003/etc/hostname.exp b/src/test/test-alpine-003/etc/hostname.exp
new file mode 100644
index 0000000..df6b0d2
--- /dev/null
+++ b/src/test/test-alpine-003/etc/hostname.exp
@@ -0,0 +1 @@
+test3
diff --git a/src/test/test-alpine-003/etc/hosts b/src/test/test-alpine-003/etc/hosts
new file mode 100644
index 0000000..22ec15f
--- /dev/null
+++ b/src/test/test-alpine-003/etc/hosts
@@ -0,0 +1,5 @@
+127.0.0.1	localhost localhost.localdomain
+::1		localhost localhost.localdomain
+# --- BEGIN PVE ---
+127.0.1.1 test3.proxmox.com test3
+# --- END PVE ---
diff --git a/src/test/test-alpine-003/etc/hosts.exp b/src/test/test-alpine-003/etc/hosts.exp
new file mode 100644
index 0000000..1d122ce
--- /dev/null
+++ b/src/test/test-alpine-003/etc/hosts.exp
@@ -0,0 +1,5 @@
+127.0.0.1	localhost localhost.localdomain
+::1		localhost localhost.localdomain
+# --- BEGIN PVE ---
+10.0.0.100 test3.proxmox.com test3
+# --- END PVE ---
diff --git a/src/test/test-alpine-003/etc/network/interfaces b/src/test/test-alpine-003/etc/network/interfaces
new file mode 100644
index 0000000..e69de29
diff --git a/src/test/test-alpine-003/etc/passwd b/src/test/test-alpine-003/etc/passwd
new file mode 100644
index 0000000..9fc110f
--- /dev/null
+++ b/src/test/test-alpine-003/etc/passwd
@@ -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-alpine-003/roothome/.ssh/authorized_keys.exp b/src/test/test-alpine-003/roothome/.ssh/authorized_keys.exp
new file mode 100644
index 0000000..1cb3ec3
--- /dev/null
+++ b/src/test/test-alpine-003/roothome/.ssh/authorized_keys.exp
@@ -0,0 +1,3 @@
+# --- BEGIN PVE ---
+ssh-rsa ABCDEFG ABC at DEF
+# --- END PVE ---
-- 
2.30.2






More information about the pve-devel mailing list