* [pve-devel] [PATCH v2 container 1/2] CentOS6 is obsolete. Tests renamed to centos7.
@ 2021-06-16 18:23 Denis Knauf
2021-06-16 18:23 ` [pve-devel] [PATCH v2 container 2/2] close #3471: Support for NetworkManager on CentOS Denis Knauf
0 siblings, 1 reply; 5+ messages in thread
From: Denis Knauf @ 2021-06-16 18:23 UTC (permalink / raw)
To: pve-devel; +Cc: Denis Knauf
Signed-off-by: Denis Knauf <deac+git@denkn.at>
---
src/test/{test-centos6-001 => test-centos7-001}/config | 0
src/test/{test-centos6-001 => test-centos7-001}/etc/hosts.exp | 0
.../etc/init/power-status-changed.conf.exp | 0
.../etc/init/start-ttys.conf.exp | 0
.../{test-centos6-001 => test-centos7-001}/etc/init/tty.conf.exp | 0
.../{test-centos6-001 => test-centos7-001}/etc/rc.d/rc.sysinit | 0
.../etc/rc.d/rc.sysinit.exp | 0
.../{test-centos6-001 => test-centos7-001}/etc/redhat-release | 0
.../{test-centos6-001 => test-centos7-001}/etc/resolv.conf.exp | 0
src/test/{test-centos6-001 => test-centos7-001}/etc/securetty | 0
src/test/{test-centos6-001 => test-centos7-001}/etc/securetty.exp | 0
.../{test-centos6-001 => test-centos7-001}/etc/sysconfig/network | 0
.../etc/sysconfig/network-scripts/ifcfg-eth0.exp | 0
.../etc/sysconfig/network-scripts/ifcfg-eth1.exp | 0
.../etc/sysconfig/network.exp | 0
.../root/.ssh/authorized_keys.exp | 0
src/test/{test-centos6-002 => test-centos7-002}/config | 0
.../{test-centos6-002 => test-centos7-002}/etc/rc.d/rc.sysinit | 0
.../{test-centos6-002 => test-centos7-002}/etc/redhat-release | 0
src/test/{test-centos6-002 => test-centos7-002}/etc/securetty | 0
.../{test-centos6-002 => test-centos7-002}/etc/sysconfig/network | 0
.../etc/sysconfig/network-scripts/ifcfg-eth0.exp | 0
.../etc/sysconfig/network-scripts/ifcfg-eth1.exp | 0
.../etc/sysconfig/network-scripts/route-eth0.exp | 0
.../etc/sysconfig/network-scripts/route6-eth0.exp | 0
.../etc/sysconfig/network.exp | 0
.../root/.ssh/authorized_keys.exp | 0
27 files changed, 0 insertions(+), 0 deletions(-)
rename src/test/{test-centos6-001 => test-centos7-001}/config (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/hosts.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/init/power-status-changed.conf.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/init/start-ttys.conf.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/init/tty.conf.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/rc.d/rc.sysinit (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/rc.d/rc.sysinit.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/redhat-release (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/resolv.conf.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/securetty (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/securetty.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/sysconfig/network (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/sysconfig/network-scripts/ifcfg-eth0.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/sysconfig/network-scripts/ifcfg-eth1.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/etc/sysconfig/network.exp (100%)
rename src/test/{test-centos6-001 => test-centos7-001}/root/.ssh/authorized_keys.exp (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/config (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/rc.d/rc.sysinit (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/redhat-release (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/securetty (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/sysconfig/network (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/sysconfig/network-scripts/ifcfg-eth0.exp (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/sysconfig/network-scripts/ifcfg-eth1.exp (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/sysconfig/network-scripts/route-eth0.exp (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/sysconfig/network-scripts/route6-eth0.exp (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/etc/sysconfig/network.exp (100%)
rename src/test/{test-centos6-002 => test-centos7-002}/root/.ssh/authorized_keys.exp (100%)
diff --git a/src/test/test-centos6-001/config b/src/test/test-centos7-001/config
similarity index 100%
rename from src/test/test-centos6-001/config
rename to src/test/test-centos7-001/config
diff --git a/src/test/test-centos6-001/etc/hosts.exp b/src/test/test-centos7-001/etc/hosts.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/hosts.exp
rename to src/test/test-centos7-001/etc/hosts.exp
diff --git a/src/test/test-centos6-001/etc/init/power-status-changed.conf.exp b/src/test/test-centos7-001/etc/init/power-status-changed.conf.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/init/power-status-changed.conf.exp
rename to src/test/test-centos7-001/etc/init/power-status-changed.conf.exp
diff --git a/src/test/test-centos6-001/etc/init/start-ttys.conf.exp b/src/test/test-centos7-001/etc/init/start-ttys.conf.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/init/start-ttys.conf.exp
rename to src/test/test-centos7-001/etc/init/start-ttys.conf.exp
diff --git a/src/test/test-centos6-001/etc/init/tty.conf.exp b/src/test/test-centos7-001/etc/init/tty.conf.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/init/tty.conf.exp
rename to src/test/test-centos7-001/etc/init/tty.conf.exp
diff --git a/src/test/test-centos6-001/etc/rc.d/rc.sysinit b/src/test/test-centos7-001/etc/rc.d/rc.sysinit
similarity index 100%
rename from src/test/test-centos6-001/etc/rc.d/rc.sysinit
rename to src/test/test-centos7-001/etc/rc.d/rc.sysinit
diff --git a/src/test/test-centos6-001/etc/rc.d/rc.sysinit.exp b/src/test/test-centos7-001/etc/rc.d/rc.sysinit.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/rc.d/rc.sysinit.exp
rename to src/test/test-centos7-001/etc/rc.d/rc.sysinit.exp
diff --git a/src/test/test-centos6-001/etc/redhat-release b/src/test/test-centos7-001/etc/redhat-release
similarity index 100%
rename from src/test/test-centos6-001/etc/redhat-release
rename to src/test/test-centos7-001/etc/redhat-release
diff --git a/src/test/test-centos6-001/etc/resolv.conf.exp b/src/test/test-centos7-001/etc/resolv.conf.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/resolv.conf.exp
rename to src/test/test-centos7-001/etc/resolv.conf.exp
diff --git a/src/test/test-centos6-001/etc/securetty b/src/test/test-centos7-001/etc/securetty
similarity index 100%
rename from src/test/test-centos6-001/etc/securetty
rename to src/test/test-centos7-001/etc/securetty
diff --git a/src/test/test-centos6-001/etc/securetty.exp b/src/test/test-centos7-001/etc/securetty.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/securetty.exp
rename to src/test/test-centos7-001/etc/securetty.exp
diff --git a/src/test/test-centos6-001/etc/sysconfig/network b/src/test/test-centos7-001/etc/sysconfig/network
similarity index 100%
rename from src/test/test-centos6-001/etc/sysconfig/network
rename to src/test/test-centos7-001/etc/sysconfig/network
diff --git a/src/test/test-centos6-001/etc/sysconfig/network-scripts/ifcfg-eth0.exp b/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth0.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/sysconfig/network-scripts/ifcfg-eth0.exp
rename to src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth0.exp
diff --git a/src/test/test-centos6-001/etc/sysconfig/network-scripts/ifcfg-eth1.exp b/src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth1.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/sysconfig/network-scripts/ifcfg-eth1.exp
rename to src/test/test-centos7-001/etc/sysconfig/network-scripts/ifcfg-eth1.exp
diff --git a/src/test/test-centos6-001/etc/sysconfig/network.exp b/src/test/test-centos7-001/etc/sysconfig/network.exp
similarity index 100%
rename from src/test/test-centos6-001/etc/sysconfig/network.exp
rename to src/test/test-centos7-001/etc/sysconfig/network.exp
diff --git a/src/test/test-centos6-001/root/.ssh/authorized_keys.exp b/src/test/test-centos7-001/root/.ssh/authorized_keys.exp
similarity index 100%
rename from src/test/test-centos6-001/root/.ssh/authorized_keys.exp
rename to src/test/test-centos7-001/root/.ssh/authorized_keys.exp
diff --git a/src/test/test-centos6-002/config b/src/test/test-centos7-002/config
similarity index 100%
rename from src/test/test-centos6-002/config
rename to src/test/test-centos7-002/config
diff --git a/src/test/test-centos6-002/etc/rc.d/rc.sysinit b/src/test/test-centos7-002/etc/rc.d/rc.sysinit
similarity index 100%
rename from src/test/test-centos6-002/etc/rc.d/rc.sysinit
rename to src/test/test-centos7-002/etc/rc.d/rc.sysinit
diff --git a/src/test/test-centos6-002/etc/redhat-release b/src/test/test-centos7-002/etc/redhat-release
similarity index 100%
rename from src/test/test-centos6-002/etc/redhat-release
rename to src/test/test-centos7-002/etc/redhat-release
diff --git a/src/test/test-centos6-002/etc/securetty b/src/test/test-centos7-002/etc/securetty
similarity index 100%
rename from src/test/test-centos6-002/etc/securetty
rename to src/test/test-centos7-002/etc/securetty
diff --git a/src/test/test-centos6-002/etc/sysconfig/network b/src/test/test-centos7-002/etc/sysconfig/network
similarity index 100%
rename from src/test/test-centos6-002/etc/sysconfig/network
rename to src/test/test-centos7-002/etc/sysconfig/network
diff --git a/src/test/test-centos6-002/etc/sysconfig/network-scripts/ifcfg-eth0.exp b/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth0.exp
similarity index 100%
rename from src/test/test-centos6-002/etc/sysconfig/network-scripts/ifcfg-eth0.exp
rename to src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth0.exp
diff --git a/src/test/test-centos6-002/etc/sysconfig/network-scripts/ifcfg-eth1.exp b/src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth1.exp
similarity index 100%
rename from src/test/test-centos6-002/etc/sysconfig/network-scripts/ifcfg-eth1.exp
rename to src/test/test-centos7-002/etc/sysconfig/network-scripts/ifcfg-eth1.exp
diff --git a/src/test/test-centos6-002/etc/sysconfig/network-scripts/route-eth0.exp b/src/test/test-centos7-002/etc/sysconfig/network-scripts/route-eth0.exp
similarity index 100%
rename from src/test/test-centos6-002/etc/sysconfig/network-scripts/route-eth0.exp
rename to src/test/test-centos7-002/etc/sysconfig/network-scripts/route-eth0.exp
diff --git a/src/test/test-centos6-002/etc/sysconfig/network-scripts/route6-eth0.exp b/src/test/test-centos7-002/etc/sysconfig/network-scripts/route6-eth0.exp
similarity index 100%
rename from src/test/test-centos6-002/etc/sysconfig/network-scripts/route6-eth0.exp
rename to src/test/test-centos7-002/etc/sysconfig/network-scripts/route6-eth0.exp
diff --git a/src/test/test-centos6-002/etc/sysconfig/network.exp b/src/test/test-centos7-002/etc/sysconfig/network.exp
similarity index 100%
rename from src/test/test-centos6-002/etc/sysconfig/network.exp
rename to src/test/test-centos7-002/etc/sysconfig/network.exp
diff --git a/src/test/test-centos6-002/root/.ssh/authorized_keys.exp b/src/test/test-centos7-002/root/.ssh/authorized_keys.exp
similarity index 100%
rename from src/test/test-centos6-002/root/.ssh/authorized_keys.exp
rename to src/test/test-centos7-002/root/.ssh/authorized_keys.exp
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pve-devel] [PATCH v2 container 2/2] close #3471: Support for NetworkManager on CentOS.
2021-06-16 18:23 [pve-devel] [PATCH v2 container 1/2] CentOS6 is obsolete. Tests renamed to centos7 Denis Knauf
@ 2021-06-16 18:23 ` Denis Knauf
2021-06-17 12:28 ` Dominik Csapak
0 siblings, 1 reply; 5+ messages in thread
From: Denis Knauf @ 2021-06-16 18:23 UTC (permalink / raw)
To: pve-devel; +Cc: Denis Knauf
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 <deac+git@denkn.at>
---
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</ifcfg-eth\d\.exp$>) {
+ 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH v2 container 2/2] close #3471: Support for NetworkManager on CentOS.
2021-06-16 18:23 ` [pve-devel] [PATCH v2 container 2/2] close #3471: Support for NetworkManager on CentOS Denis Knauf
@ 2021-06-17 12:28 ` Dominik Csapak
2021-06-17 12:33 ` Fabian Grünbichler
0 siblings, 1 reply; 5+ messages in thread
From: Dominik Csapak @ 2021-06-17 12:28 UTC (permalink / raw)
To: Proxmox VE development discussion, Denis Knauf
hi,
did not took a look at the whole patch, but
some things stood out, comments inline
On 6/16/21 20:23, Denis Knauf wrote:
> 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 <deac+git@denkn.at>
> ---
> 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";
is it intended that the uuid changes on every network change?
(idk how network manager wants that)
> 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') {
this change does nothing?
> $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</ifcfg-eth\d\.exp$>) {
> + 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;
while i get that some of this hunk is necessary,
some of it (the system("a b c") to system("a", "b", "c") )
is not, and would be better in its own patch
also note that we can do better than 'system'
as we have a 'run_command' in PVE::Tools, that can handle
many things (such as shellquoting) for us
> }
>
> 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 ---
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH v2 container 2/2] close #3471: Support for NetworkManager on CentOS.
2021-06-17 12:28 ` Dominik Csapak
@ 2021-06-17 12:33 ` Fabian Grünbichler
2021-06-17 12:58 ` Dominik Csapak
0 siblings, 1 reply; 5+ messages in thread
From: Fabian Grünbichler @ 2021-06-17 12:33 UTC (permalink / raw)
To: Denis Knauf, Proxmox VE development discussion
On June 17, 2021 2:28 pm, Dominik Csapak wrote:
> hi,
>
> did not took a look at the whole patch, but
> some things stood out, comments inline
>
> On 6/16/21 20:23, Denis Knauf wrote:
>> 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 <deac+git@denkn.at>
...
>
>> 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') {
>
> this change does nothing?
it changes the condition for the else branch below (previously, ip6 ==
auto would take it, now it does not - see the bug report).
>
>> $data .= "DHCPV6C=yes\n";
>> } else {
>> $data .= "IPV6ADDR=$d->{ip6}\n";
>> @@ -229,6 +230,15 @@ sub setup_network {
>> }
>> }
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [pve-devel] [PATCH v2 container 2/2] close #3471: Support for NetworkManager on CentOS.
2021-06-17 12:33 ` Fabian Grünbichler
@ 2021-06-17 12:58 ` Dominik Csapak
0 siblings, 0 replies; 5+ messages in thread
From: Dominik Csapak @ 2021-06-17 12:58 UTC (permalink / raw)
To: pve-devel
On 6/17/21 14:33, Fabian Grünbichler wrote:
> On June 17, 2021 2:28 pm, Dominik Csapak wrote:
>>> 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') {
>>
>> this change does nothing?
>
> it changes the condition for the else branch below (previously, ip6 ==
> auto would take it, now it does not - see the bug report).
ah yes thanks^^
stared at it for a few minutes and did not see it...
>
>>
>>> $data .= "DHCPV6C=yes\n";
>>> } else {
>>> $data .= "IPV6ADDR=$d->{ip6}\n";
>>> @@ -229,6 +230,15 @@ sub setup_network {
>>> }
>>> }
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-17 12:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 18:23 [pve-devel] [PATCH v2 container 1/2] CentOS6 is obsolete. Tests renamed to centos7 Denis Knauf
2021-06-16 18:23 ` [pve-devel] [PATCH v2 container 2/2] close #3471: Support for NetworkManager on CentOS Denis Knauf
2021-06-17 12:28 ` Dominik Csapak
2021-06-17 12:33 ` Fabian Grünbichler
2021-06-17 12:58 ` Dominik Csapak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox