From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A519572C75 for ; Wed, 16 Jun 2021 20:24:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9644515165 for ; Wed, 16 Jun 2021 20:24:22 +0200 (CEST) Received: from niob.denkn.at (niob.denkn.at [IPv6:2a01:4f8:c17:5c86::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id C226B15150 for ; Wed, 16 Jun 2021 20:24:18 +0200 (CEST) Received: from ferrum.home (193-154-227-246.adsl.highway.telekom.at [193.154.227.246]) by niob.denkn.at (Postfix) with ESMTPSA id 4G4tqw2m91zB4hQ3; Wed, 16 Jun 2021 20:24:12 +0200 (CEST) Authentication-Results: niob.denkn.at; dmarc=fail (p=reject dis=none) header.from=denkn.at DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denkn.at; s=2016; t=1623867852; bh=42LMRW8nrBoj5gnIN1yp54yXtxcUsVtAYZg+fGggbFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IvZDKagcX8vqqlY8CRUJ6GtupdFfbThAiIsFyoZvp5FEMdSF7tlJvR90+pcd4BHLP pTjnYhHWOcqNUwpyXUc/gcSzluHasBHnON1gfAwMLua9xOh+YiT/hVAsr4EIW2XrSz VCpSDlrjL7wfzORjpanzvD2FSegkA3++7LnRPTFA= From: Denis Knauf To: pve-devel@lists.proxmox.com Cc: Denis Knauf Date: Wed, 16 Jun 2021 20:23:17 +0200 Message-Id: <20210616182317.12758-2-deac+git@denkn.at> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210616182317.12758-1-deac+git@denkn.at> References: <20210616182317.12758-1-deac+git@denkn.at> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [centos.pm, denkn.at, proxmox.com] X-Mailman-Approved-At: Wed, 16 Jun 2021 21:20:05 +0200 Subject: [pve-devel] [PATCH v2 container 2/2] close #3471: Support for NetworkManager on CentOS. X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2021 18:24:52 -0000 NetworkManager is used on RHEL8 and similar distributions like CentOS8, AlmaLinux8 and RockyLinux8. On RHEL7/CentOS7 it was not mandatory, but possible to use NetworkManager. The past config was used on CentOS6/7 withour NetworkManager, so tests were also testing this basic network-config. The patches is compatible to any RHEL7/RHEL8-compatible distribution with/without NetworkManager. Because the NetworkManager requires a UUID, the tests were extended by special behaviour in case of UUIDs in `ifcfg-eth*`. Successfully tested against: * CentOS7 without NetworkManager * CentOS7 with NetworkManager * CentOS8 * RockyLinux 8 Signed-off-by: Denis Knauf --- src/PVE/LXC/Setup/CentOS.pm | 14 ++++++++-- src/test/run_setup_tests.pl | 15 ++++++---- .../sysconfig/network-scripts/ifcfg-eth0.exp | 4 +++ .../sysconfig/network-scripts/ifcfg-eth1.exp | 4 +++ .../sysconfig/network-scripts/ifcfg-eth0.exp | 4 +++ .../sysconfig/network-scripts/ifcfg-eth1.exp | 4 +++ src/test/test-centos7-003/config | 4 +++ src/test/test-centos7-003/etc/hosts.exp | 5 ++++ .../etc/init/power-status-changed.conf.exp | 5 ++++ .../etc/init/start-ttys.conf.exp | 18 ++++++++++++ .../test-centos7-003/etc/init/tty.conf.exp | 13 +++++++++ src/test/test-centos7-003/etc/rc.d/rc.sysinit | 6 ++++ .../test-centos7-003/etc/rc.d/rc.sysinit.exp | 6 ++++ src/test/test-centos7-003/etc/redhat-release | 1 + src/test/test-centos7-003/etc/resolv.conf.exp | 5 ++++ src/test/test-centos7-003/etc/securetty | 23 +++++++++++++++ src/test/test-centos7-003/etc/securetty.exp | 28 +++++++++++++++++++ .../test-centos7-003/etc/sysconfig/network | 0 .../sysconfig/network-scripts/ifcfg-eth0.exp | 12 ++++++++ .../sysconfig/network-scripts/ifcfg-eth1.exp | 12 ++++++++ .../etc/sysconfig/network.exp | 3 ++ .../root/.ssh/authorized_keys.exp | 3 ++ src/test/test-centos7-004/config | 4 +++ src/test/test-centos7-004/etc/hosts.exp | 5 ++++ .../etc/init/power-status-changed.conf.exp | 5 ++++ .../etc/init/start-ttys.conf.exp | 18 ++++++++++++ .../test-centos7-004/etc/init/tty.conf.exp | 13 +++++++++ src/test/test-centos7-004/etc/rc.d/rc.sysinit | 6 ++++ .../test-centos7-004/etc/rc.d/rc.sysinit.exp | 6 ++++ src/test/test-centos7-004/etc/redhat-release | 1 + src/test/test-centos7-004/etc/resolv.conf.exp | 5 ++++ src/test/test-centos7-004/etc/securetty | 23 +++++++++++++++ src/test/test-centos7-004/etc/securetty.exp | 28 +++++++++++++++++++ .../test-centos7-004/etc/sysconfig/network | 0 .../sysconfig/network-scripts/ifcfg-eth0.exp | 12 ++++++++ .../sysconfig/network-scripts/ifcfg-eth1.exp | 12 ++++++++ .../etc/sysconfig/network.exp | 3 ++ .../root/.ssh/authorized_keys.exp | 3 ++ 38 files changed, 326 insertions(+), 7 deletions(-) create mode 100644 src/test/test-centos7-003/config create mode 100644 src/test/test-centos7-003/etc/hosts.exp create mode 100644 src/test/test-centos7-003/etc/init/power-status-changed.conf.exp create mode 100644 src/test/test-centos7-003/etc/init/start-ttys.conf.exp create mode 100644 src/test/test-centos7-003/etc/init/tty.conf.exp create mode 100644 src/test/test-centos7-003/etc/rc.d/rc.sysinit create mode 100644 src/test/test-centos7-003/etc/rc.d/rc.sysinit.exp create mode 100644 src/test/test-centos7-003/etc/redhat-release create mode 100644 src/test/test-centos7-003/etc/resolv.conf.exp create mode 100644 src/test/test-centos7-003/etc/securetty create mode 100644 src/test/test-centos7-003/etc/securetty.exp create mode 100644 src/test/test-centos7-003/etc/sysconfig/network create mode 100644 src/test/test-centos7-003/etc/sysconfig/network-scripts/ifcfg-eth0.exp create mode 100644 src/test/test-centos7-003/etc/sysconfig/network-scripts/ifcfg-eth1.exp create mode 100644 src/test/test-centos7-003/etc/sysconfig/network.exp create mode 100644 src/test/test-centos7-003/root/.ssh/authorized_keys.exp create mode 100644 src/test/test-centos7-004/config create mode 100644 src/test/test-centos7-004/etc/hosts.exp create mode 100644 src/test/test-centos7-004/etc/init/power-status-changed.conf.exp create mode 100644 src/test/test-centos7-004/etc/init/start-ttys.conf.exp create mode 100644 src/test/test-centos7-004/etc/init/tty.conf.exp create mode 100644 src/test/test-centos7-004/etc/rc.d/rc.sysinit create mode 100644 src/test/test-centos7-004/etc/rc.d/rc.sysinit.exp create mode 100644 src/test/test-centos7-004/etc/redhat-release create mode 100644 src/test/test-centos7-004/etc/resolv.conf.exp create mode 100644 src/test/test-centos7-004/etc/securetty create mode 100644 src/test/test-centos7-004/etc/securetty.exp create mode 100644 src/test/test-centos7-004/etc/sysconfig/network create mode 100644 src/test/test-centos7-004/etc/sysconfig/network-scripts/ifcfg-eth0.exp create mode 100644 src/test/test-centos7-004/etc/sysconfig/network-scripts/ifcfg-eth1.exp create mode 100644 src/test/test-centos7-004/etc/sysconfig/network.exp create mode 100644 src/test/test-centos7-004/root/.ssh/authorized_keys.exp diff --git a/src/PVE/LXC/Setup/CentOS.pm b/src/PVE/LXC/Setup/CentOS.pm index 77eb6f7..ba11f81 100644 --- a/src/PVE/LXC/Setup/CentOS.pm +++ b/src/PVE/LXC/Setup/CentOS.pm @@ -10,6 +10,7 @@ use PVE::LXC; use PVE::LXC::Setup::Base; use base qw(PVE::LXC::Setup::Base); +use UUID; sub new { my ($class, $conf, $rootdir) = @_; @@ -185,7 +186,7 @@ sub setup_network { my $routes = ''; my $routes6 = ''; - my $header = "DEVICE=$d->{name}\nONBOOT=yes\n"; + my $header = "DEVICE=$d->{name}\nONBOOT=yes\nUUID=".UUID::uuid()."\n"; my $data = ''; my $bootproto = ''; @@ -213,7 +214,7 @@ sub setup_network { if ($d->{ip6} eq 'auto') { $data .= "IPV6_AUTOCONF=yes\n"; } - if ($d->{ip6} eq 'dhcp') { + elsif ($d->{ip6} eq 'dhcp') { $data .= "DHCPV6C=yes\n"; } else { $data .= "IPV6ADDR=$d->{ip6}\n"; @@ -229,6 +230,15 @@ sub setup_network { } } + my ($searchdomains, $nameserver) = $self->lookup_dns_conf($conf); + my @nameservers = PVE::Tools::split_list($nameserver); + + for my $i (0 .. $#nameservers) { + $data .= "DNS".($i+1)."=$nameservers[$i]\n"; + } + $data .= "DOMAIN=".join(' ', PVE::Tools::split_list($searchdomains))."\n" + if $searchdomains; + next unless $data || $bootproto; $header .= "BOOTPROTO=$bootproto\n"; $self->ct_file_set_contents($filename, $header . $data); diff --git a/src/test/run_setup_tests.pl b/src/test/run_setup_tests.pl index 582a97b..1c60102 100755 --- a/src/test/run_setup_tests.pl +++ b/src/test/run_setup_tests.pl @@ -17,14 +17,19 @@ sub test_file { my ($exp_fn, $real_fn) = @_; # replace @DAYS@ with the current correct value - if ($exp_fn =~ m/shadow.exp$/) { + if ($exp_fn =~ m/shadow\.exp$/) { my $expecteddays = int(time()/(60*60*24)); - system ("sed -i.bak 's/\@DAYS\@/$expecteddays/' $exp_fn"); - my $ret = system("diff -u '$exp_fn' '$real_fn'"); - system("mv '$exp_fn.bak' '$exp_fn'"); + system ('sed', '-i.bak', 's/\@DAYS\@/'.$expecteddays.'/', $exp_fn); + my $ret = system('diff', '-u', $exp_fn, $real_fn); + system('mv', "$exp_fn.bak", $exp_fn); + return if $ret == 0; + } elsif ($exp_fn =~ m) { + system ('sed', '-i.bak', '-Ee', 's/\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/@UUID@/g', $real_fn); + my $ret = system('diff', '-u', $exp_fn, $real_fn); + system('mv', "$real_fn.bak", $real_fn); return if $ret == 0; } else { - return if system("diff -u '$exp_fn' '$real_fn'") == 0; + return if system('diff', '-u', $exp_fn, $real_fn) == 0; } die "files do not match\n"; diff --git a/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth0.exp b/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth0.exp index 2c5e570..5e0d93c 100644 --- a/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth0.exp +++ b/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth0.exp @@ -1,6 +1,10 @@ DEVICE=eth0 ONBOOT=yes +UUID=@UUID@ BOOTPROTO=none IPADDR=1.2.3.4 NETMASK=255.255.255.0 GATEWAY=1.2.3.1 +DNS1=8.8.8.8 +DNS2=8.8.8.9 +DOMAIN=proxmox.com diff --git a/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth1.exp b/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth1.exp index 7be5df0..b7b3fe7 100644 --- a/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth1.exp +++ b/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth1.exp @@ -1,5 +1,9 @@ DEVICE=eth1 ONBOOT=yes +UUID=@UUID@ BOOTPROTO=none IPADDR=10.2.3.4 NETMASK=255.255.255.0 +DNS1=8.8.8.8 +DNS2=8.8.8.9 +DOMAIN=proxmox.com diff --git a/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth0.exp b/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth0.exp index 6f04e03..9e8ff90 100644 --- a/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth0.exp +++ b/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth0.exp @@ -1,8 +1,12 @@ DEVICE=eth0 ONBOOT=yes +UUID=@UUID@ BOOTPROTO=none IPADDR=1.2.3.4 NETMASK=255.255.255.0 GATEWAY=4.3.2.1 IPV6INIT=yes IPV6ADDR=2000::1/64 +DNS1=8.8.8.8 +DNS2=8.8.8.9 +DOMAIN=proxmox.com diff --git a/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth1.exp b/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth1.exp index a97b78b..4358122 100644 --- a/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth1.exp +++ b/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth1.exp @@ -1,6 +1,10 @@ DEVICE=eth1 ONBOOT=yes +UUID=@UUID@ BOOTPROTO=none IPV6INIT=yes IPV6ADDR=2222::1/64 IPV6_DEFAULTGW=fe80::1 +DNS1=8.8.8.8 +DNS2=8.8.8.9 +DOMAIN=proxmox.com diff --git a/src/test/test-centos7-003/config b/src/test/test-centos7-003/config new file mode 100644 index 0000000..a13b503 --- /dev/null +++ b/src/test/test-centos7-003/config @@ -0,0 +1,4 @@ +hostname: test1 +net0: bridge=vmbr0,name=eth0,ip=1.2.3.4/24,gw=1.2.3.1,ip6=auto +net1: bridge=vmbr0,name=eth1,ip=10.2.3.4/24,ip6=100::1234/64,gw6=100::ffff +net2: bridge=vmbr0,name=eth2 diff --git a/src/test/test-centos7-003/etc/hosts.exp b/src/test/test-centos7-003/etc/hosts.exp new file mode 100644 index 0000000..01ac197 --- /dev/null +++ b/src/test/test-centos7-003/etc/hosts.exp @@ -0,0 +1,5 @@ +# --- BEGIN PVE --- +127.0.0.1 localhost.localnet localhost +::1 localhost.localnet localhost +1.2.3.4 test1.proxmox.com test1 +# --- END PVE --- diff --git a/src/test/test-centos7-003/etc/init/power-status-changed.conf.exp b/src/test/test-centos7-003/etc/init/power-status-changed.conf.exp new file mode 100644 index 0000000..0763ae5 --- /dev/null +++ b/src/test/test-centos7-003/etc/init/power-status-changed.conf.exp @@ -0,0 +1,5 @@ +# power-status-changed - shutdown on SIGPWR +# +start on power-status-changed + +exec /sbin/shutdown -h now "SIGPWR received" diff --git a/src/test/test-centos7-003/etc/init/start-ttys.conf.exp b/src/test/test-centos7-003/etc/init/start-ttys.conf.exp new file mode 100644 index 0000000..20e379b --- /dev/null +++ b/src/test/test-centos7-003/etc/init/start-ttys.conf.exp @@ -0,0 +1,18 @@ +# +# This service starts the configured number of gettys. +# +# Do not edit this file directly. If you want to change the behaviour, +# please create a file start-ttys.override and put your changes there. + +start on stopped rc RUNLEVEL=[2345] + +env ACTIVE_CONSOLES=/dev/tty[1-6] +env X_TTY=/dev/tty1 +task +script + . /etc/sysconfig/init + for tty in $(echo $ACTIVE_CONSOLES) ; do + [ "$RUNLEVEL" = "5" -a "$tty" = "$X_TTY" ] && continue + initctl start tty TTY=$tty + done +end script diff --git a/src/test/test-centos7-003/etc/init/tty.conf.exp b/src/test/test-centos7-003/etc/init/tty.conf.exp new file mode 100644 index 0000000..efad240 --- /dev/null +++ b/src/test/test-centos7-003/etc/init/tty.conf.exp @@ -0,0 +1,13 @@ +# tty - getty +# +# This service maintains a getty on the specified device. +# +# Do not edit this file directly. If you want to change the behaviour, +# please create a file tty.override and put your changes there. + +stop on runlevel [S016] + +respawn +instance $TTY +exec /sbin/mingetty --nohangup $TTY +usage 'tty TTY=/dev/ttyX - where X is console id' diff --git a/src/test/test-centos7-003/etc/rc.d/rc.sysinit b/src/test/test-centos7-003/etc/rc.d/rc.sysinit new file mode 100644 index 0000000..a98b7dd --- /dev/null +++ b/src/test/test-centos7-003/etc/rc.d/rc.sysinit @@ -0,0 +1,6 @@ +# just a test +# dummy + +/sbin/start_udev xxxxxxxxxxyyyyyyzzzz + + diff --git a/src/test/test-centos7-003/etc/rc.d/rc.sysinit.exp b/src/test/test-centos7-003/etc/rc.d/rc.sysinit.exp new file mode 100644 index 0000000..097907e --- /dev/null +++ b/src/test/test-centos7-003/etc/rc.d/rc.sysinit.exp @@ -0,0 +1,6 @@ +# just a test +# dummy + +#/sbin/start_udev xxxxxxxxxxyyyyyyzzzz + + diff --git a/src/test/test-centos7-003/etc/redhat-release b/src/test/test-centos7-003/etc/redhat-release new file mode 100644 index 0000000..cdb73e8 --- /dev/null +++ b/src/test/test-centos7-003/etc/redhat-release @@ -0,0 +1 @@ +CentOS release 6.3 (Final) diff --git a/src/test/test-centos7-003/etc/resolv.conf.exp b/src/test/test-centos7-003/etc/resolv.conf.exp new file mode 100644 index 0000000..35181cc --- /dev/null +++ b/src/test/test-centos7-003/etc/resolv.conf.exp @@ -0,0 +1,5 @@ +# --- BEGIN PVE --- +search proxmox.com +nameserver 8.8.8.8 +nameserver 8.8.8.9 +# --- END PVE --- diff --git a/src/test/test-centos7-003/etc/securetty b/src/test/test-centos7-003/etc/securetty new file mode 100644 index 0000000..fae1648 --- /dev/null +++ b/src/test/test-centos7-003/etc/securetty @@ -0,0 +1,23 @@ +console +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 +vc/9 +vc/10 +vc/11 +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +tty7 +tty8 +tty9 +tty10 +tty11 \ No newline at end of file diff --git a/src/test/test-centos7-003/etc/securetty.exp b/src/test/test-centos7-003/etc/securetty.exp new file mode 100644 index 0000000..573c668 --- /dev/null +++ b/src/test/test-centos7-003/etc/securetty.exp @@ -0,0 +1,28 @@ +console +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 +vc/9 +vc/10 +vc/11 +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +tty7 +tty8 +tty9 +tty10 +tty11 +lxc/console +lxc/tty1 +lxc/tty2 +lxc/tty3 +lxc/tty4 diff --git a/src/test/test-centos7-003/etc/sysconfig/network b/src/test/test-centos7-003/etc/sysconfig/network new file mode 100644 index 0000000..e69de29 diff --git a/src/test/test-centos7-003/etc/sysconfig/network-scripts/ifcfg-eth0.exp b/src/test/test-centos7-003/etc/sysconfig/network-scripts/ifcfg-eth0.exp new file mode 100644 index 0000000..6e0bebc --- /dev/null +++ b/src/test/test-centos7-003/etc/sysconfig/network-scripts/ifcfg-eth0.exp @@ -0,0 +1,12 @@ +DEVICE=eth0 +ONBOOT=yes +UUID=@UUID@ +BOOTPROTO=none +IPADDR=1.2.3.4 +NETMASK=255.255.255.0 +GATEWAY=1.2.3.1 +IPV6INIT=yes +IPV6_AUTOCONF=yes +DNS1=8.8.8.8 +DNS2=8.8.8.9 +DOMAIN=proxmox.com diff --git a/src/test/test-centos7-003/etc/sysconfig/network-scripts/ifcfg-eth1.exp b/src/test/test-centos7-003/etc/sysconfig/network-scripts/ifcfg-eth1.exp new file mode 100644 index 0000000..64e2ad2 --- /dev/null +++ b/src/test/test-centos7-003/etc/sysconfig/network-scripts/ifcfg-eth1.exp @@ -0,0 +1,12 @@ +DEVICE=eth1 +ONBOOT=yes +UUID=@UUID@ +BOOTPROTO=none +IPADDR=10.2.3.4 +NETMASK=255.255.255.0 +IPV6INIT=yes +IPV6ADDR=100::1234/64 +IPV6_DEFAULTGW=100::ffff +DNS1=8.8.8.8 +DNS2=8.8.8.9 +DOMAIN=proxmox.com diff --git a/src/test/test-centos7-003/etc/sysconfig/network.exp b/src/test/test-centos7-003/etc/sysconfig/network.exp new file mode 100644 index 0000000..9a37270 --- /dev/null +++ b/src/test/test-centos7-003/etc/sysconfig/network.exp @@ -0,0 +1,3 @@ +NETWORKING=yes +NETWORKING_IPV6=yes +HOSTNAME=test1 diff --git a/src/test/test-centos7-003/root/.ssh/authorized_keys.exp b/src/test/test-centos7-003/root/.ssh/authorized_keys.exp new file mode 100644 index 0000000..1cb3ec3 --- /dev/null +++ b/src/test/test-centos7-003/root/.ssh/authorized_keys.exp @@ -0,0 +1,3 @@ +# --- BEGIN PVE --- +ssh-rsa ABCDEFG ABC@DEF +# --- END PVE --- diff --git a/src/test/test-centos7-004/config b/src/test/test-centos7-004/config new file mode 100644 index 0000000..a627dc4 --- /dev/null +++ b/src/test/test-centos7-004/config @@ -0,0 +1,4 @@ +hostname: test1 +net0: bridge=vmbr0,name=eth0,ip6=auto +net1: bridge=vmbr0,name=eth1,ip6=100::1234/64,gw6=100::ffff +net2: bridge=vmbr0,name=eth2 diff --git a/src/test/test-centos7-004/etc/hosts.exp b/src/test/test-centos7-004/etc/hosts.exp new file mode 100644 index 0000000..01ac197 --- /dev/null +++ b/src/test/test-centos7-004/etc/hosts.exp @@ -0,0 +1,5 @@ +# --- BEGIN PVE --- +127.0.0.1 localhost.localnet localhost +::1 localhost.localnet localhost +1.2.3.4 test1.proxmox.com test1 +# --- END PVE --- diff --git a/src/test/test-centos7-004/etc/init/power-status-changed.conf.exp b/src/test/test-centos7-004/etc/init/power-status-changed.conf.exp new file mode 100644 index 0000000..0763ae5 --- /dev/null +++ b/src/test/test-centos7-004/etc/init/power-status-changed.conf.exp @@ -0,0 +1,5 @@ +# power-status-changed - shutdown on SIGPWR +# +start on power-status-changed + +exec /sbin/shutdown -h now "SIGPWR received" diff --git a/src/test/test-centos7-004/etc/init/start-ttys.conf.exp b/src/test/test-centos7-004/etc/init/start-ttys.conf.exp new file mode 100644 index 0000000..20e379b --- /dev/null +++ b/src/test/test-centos7-004/etc/init/start-ttys.conf.exp @@ -0,0 +1,18 @@ +# +# This service starts the configured number of gettys. +# +# Do not edit this file directly. If you want to change the behaviour, +# please create a file start-ttys.override and put your changes there. + +start on stopped rc RUNLEVEL=[2345] + +env ACTIVE_CONSOLES=/dev/tty[1-6] +env X_TTY=/dev/tty1 +task +script + . /etc/sysconfig/init + for tty in $(echo $ACTIVE_CONSOLES) ; do + [ "$RUNLEVEL" = "5" -a "$tty" = "$X_TTY" ] && continue + initctl start tty TTY=$tty + done +end script diff --git a/src/test/test-centos7-004/etc/init/tty.conf.exp b/src/test/test-centos7-004/etc/init/tty.conf.exp new file mode 100644 index 0000000..efad240 --- /dev/null +++ b/src/test/test-centos7-004/etc/init/tty.conf.exp @@ -0,0 +1,13 @@ +# tty - getty +# +# This service maintains a getty on the specified device. +# +# Do not edit this file directly. If you want to change the behaviour, +# please create a file tty.override and put your changes there. + +stop on runlevel [S016] + +respawn +instance $TTY +exec /sbin/mingetty --nohangup $TTY +usage 'tty TTY=/dev/ttyX - where X is console id' diff --git a/src/test/test-centos7-004/etc/rc.d/rc.sysinit b/src/test/test-centos7-004/etc/rc.d/rc.sysinit new file mode 100644 index 0000000..a98b7dd --- /dev/null +++ b/src/test/test-centos7-004/etc/rc.d/rc.sysinit @@ -0,0 +1,6 @@ +# just a test +# dummy + +/sbin/start_udev xxxxxxxxxxyyyyyyzzzz + + diff --git a/src/test/test-centos7-004/etc/rc.d/rc.sysinit.exp b/src/test/test-centos7-004/etc/rc.d/rc.sysinit.exp new file mode 100644 index 0000000..097907e --- /dev/null +++ b/src/test/test-centos7-004/etc/rc.d/rc.sysinit.exp @@ -0,0 +1,6 @@ +# just a test +# dummy + +#/sbin/start_udev xxxxxxxxxxyyyyyyzzzz + + diff --git a/src/test/test-centos7-004/etc/redhat-release b/src/test/test-centos7-004/etc/redhat-release new file mode 100644 index 0000000..cdb73e8 --- /dev/null +++ b/src/test/test-centos7-004/etc/redhat-release @@ -0,0 +1 @@ +CentOS release 6.3 (Final) diff --git a/src/test/test-centos7-004/etc/resolv.conf.exp b/src/test/test-centos7-004/etc/resolv.conf.exp new file mode 100644 index 0000000..35181cc --- /dev/null +++ b/src/test/test-centos7-004/etc/resolv.conf.exp @@ -0,0 +1,5 @@ +# --- BEGIN PVE --- +search proxmox.com +nameserver 8.8.8.8 +nameserver 8.8.8.9 +# --- END PVE --- diff --git a/src/test/test-centos7-004/etc/securetty b/src/test/test-centos7-004/etc/securetty new file mode 100644 index 0000000..fae1648 --- /dev/null +++ b/src/test/test-centos7-004/etc/securetty @@ -0,0 +1,23 @@ +console +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 +vc/9 +vc/10 +vc/11 +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +tty7 +tty8 +tty9 +tty10 +tty11 \ No newline at end of file diff --git a/src/test/test-centos7-004/etc/securetty.exp b/src/test/test-centos7-004/etc/securetty.exp new file mode 100644 index 0000000..573c668 --- /dev/null +++ b/src/test/test-centos7-004/etc/securetty.exp @@ -0,0 +1,28 @@ +console +vc/1 +vc/2 +vc/3 +vc/4 +vc/5 +vc/6 +vc/7 +vc/8 +vc/9 +vc/10 +vc/11 +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +tty7 +tty8 +tty9 +tty10 +tty11 +lxc/console +lxc/tty1 +lxc/tty2 +lxc/tty3 +lxc/tty4 diff --git a/src/test/test-centos7-004/etc/sysconfig/network b/src/test/test-centos7-004/etc/sysconfig/network new file mode 100644 index 0000000..e69de29 diff --git a/src/test/test-centos7-004/etc/sysconfig/network-scripts/ifcfg-eth0.exp b/src/test/test-centos7-004/etc/sysconfig/network-scripts/ifcfg-eth0.exp new file mode 100644 index 0000000..6e0bebc --- /dev/null +++ b/src/test/test-centos7-004/etc/sysconfig/network-scripts/ifcfg-eth0.exp @@ -0,0 +1,12 @@ +DEVICE=eth0 +ONBOOT=yes +UUID=@UUID@ +BOOTPROTO=none +IPADDR=1.2.3.4 +NETMASK=255.255.255.0 +GATEWAY=1.2.3.1 +IPV6INIT=yes +IPV6_AUTOCONF=yes +DNS1=8.8.8.8 +DNS2=8.8.8.9 +DOMAIN=proxmox.com diff --git a/src/test/test-centos7-004/etc/sysconfig/network-scripts/ifcfg-eth1.exp b/src/test/test-centos7-004/etc/sysconfig/network-scripts/ifcfg-eth1.exp new file mode 100644 index 0000000..64e2ad2 --- /dev/null +++ b/src/test/test-centos7-004/etc/sysconfig/network-scripts/ifcfg-eth1.exp @@ -0,0 +1,12 @@ +DEVICE=eth1 +ONBOOT=yes +UUID=@UUID@ +BOOTPROTO=none +IPADDR=10.2.3.4 +NETMASK=255.255.255.0 +IPV6INIT=yes +IPV6ADDR=100::1234/64 +IPV6_DEFAULTGW=100::ffff +DNS1=8.8.8.8 +DNS2=8.8.8.9 +DOMAIN=proxmox.com diff --git a/src/test/test-centos7-004/etc/sysconfig/network.exp b/src/test/test-centos7-004/etc/sysconfig/network.exp new file mode 100644 index 0000000..9a37270 --- /dev/null +++ b/src/test/test-centos7-004/etc/sysconfig/network.exp @@ -0,0 +1,3 @@ +NETWORKING=yes +NETWORKING_IPV6=yes +HOSTNAME=test1 diff --git a/src/test/test-centos7-004/root/.ssh/authorized_keys.exp b/src/test/test-centos7-004/root/.ssh/authorized_keys.exp new file mode 100644 index 0000000..1cb3ec3 --- /dev/null +++ b/src/test/test-centos7-004/root/.ssh/authorized_keys.exp @@ -0,0 +1,3 @@ +# --- BEGIN PVE --- +ssh-rsa ABCDEFG ABC@DEF +# --- END PVE --- -- 2.25.1