diff options
author | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2016-11-12 22:48:37 +0100 |
---|---|---|
committer | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2016-11-12 22:49:11 +0100 |
commit | 9214c762c1b3717ff92351c8a217cee6726d993b (patch) | |
tree | adf12cfb124146a5c536cf061be6fed9af0dd94c | |
parent | 3b3634d02b4845cc9469423b82f6fa8ab47c3ede (diff) |
Testsuite: Assume '' for missing VERSION_ID
-rw-r--r-- | test/lib/Exim/Runtest.pm | 2 | ||||
-rw-r--r-- | test/t/00-basic.t | 7 | ||||
-rw-r--r-- | test/t/samples/debian.sid/etc/os-release | 6 | ||||
-rw-r--r-- | test/t/samples/debian8+debian-version/etc/debian_version (renamed from test/t/samples/etc.debian8-debian-version/debian_version) | 0 | ||||
-rw-r--r-- | test/t/samples/debian8+os-release/etc/debian_version (renamed from test/t/samples/etc.debian8-os-release/debian_version) | 0 | ||||
-rw-r--r-- | test/t/samples/debian8+os-release/etc/os-release (renamed from test/t/samples/etc.debian8-os-release/os-release) | 0 | ||||
-rw-r--r-- | test/t/samples/fedora24/etc/os-release (renamed from test/t/samples/etc.fedora24/os-release) | 0 |
7 files changed, 11 insertions, 4 deletions
diff --git a/test/lib/Exim/Runtest.pm b/test/lib/Exim/Runtest.pm index 32537f543..ce91084f4 100644 --- a/test/lib/Exim/Runtest.pm +++ b/test/lib/Exim/Runtest.pm @@ -119,7 +119,7 @@ sub flavour { if (open(my $f, '<', "$etc/os-release")) { local $_ = join '', <$f>; my ($id) = /^ID="?(.*?)"?\s*$/m; - my ($version) = /^VERSION_ID="?(.*?)"?\s*$/m; + my $version = /^VERSION_ID="?(.*?)"?\s*$/m ? $1 : ''; return "$id$version"; } diff --git a/test/t/00-basic.t b/test/t/00-basic.t index 49d6f6871..092591e44 100644 --- a/test/t/00-basic.t +++ b/test/t/00-basic.t @@ -40,9 +40,10 @@ subtest 'exim_binary' => sub { }; subtest 'flavour' => sub { - is flavour('t/samples/etc.debian8-os-release'), 'debian8' => 'got flavour debian8 from os-release'; - is flavour('t/samples/etc.debian8-debian-version'), 'debian8' => 'got flavour debian8 from debian_version'; - is flavour('t/samples/etc.fedora24'), 'fedora24' => 'got flavour fedora24 from os-release'; + is flavour('t/samples/debian8+os-release/etc'), 'debian8' => 'got flavour debian8 from os-release'; + is flavour('t/samples/debian8+debian-version/etc'), 'debian8' => 'got flavour debian8 from debian_version'; + is flavour('t/samples/debian.sid/etc'), 'debian' => 'got flavour debian from debian sid w/o VERSION_ID'; + is flavour('t/samples/fedora24/etc'), 'fedora24' => 'got flavour fedora24 from os-release'; is_deeply [flavours()], ['debian8'] => 'got available flavours'; }; diff --git a/test/t/samples/debian.sid/etc/os-release b/test/t/samples/debian.sid/etc/os-release new file mode 100644 index 000000000..959aa161b --- /dev/null +++ b/test/t/samples/debian.sid/etc/os-release @@ -0,0 +1,6 @@ +PRETTY_NAME="Debian GNU/Linux stretch/sid" +NAME="Debian GNU/Linux" +ID=debian +HOME_URL="https://www.debian.org/" +SUPPORT_URL="https://www.debian.org/support" +BUG_REPORT_URL="https://bugs.debian.org/" diff --git a/test/t/samples/etc.debian8-debian-version/debian_version b/test/t/samples/debian8+debian-version/etc/debian_version index 48c26da3e..48c26da3e 100644 --- a/test/t/samples/etc.debian8-debian-version/debian_version +++ b/test/t/samples/debian8+debian-version/etc/debian_version diff --git a/test/t/samples/etc.debian8-os-release/debian_version b/test/t/samples/debian8+os-release/etc/debian_version index 48c26da3e..48c26da3e 100644 --- a/test/t/samples/etc.debian8-os-release/debian_version +++ b/test/t/samples/debian8+os-release/etc/debian_version diff --git a/test/t/samples/etc.debian8-os-release/os-release b/test/t/samples/debian8+os-release/etc/os-release index 120c51b08..120c51b08 100644 --- a/test/t/samples/etc.debian8-os-release/os-release +++ b/test/t/samples/debian8+os-release/etc/os-release diff --git a/test/t/samples/etc.fedora24/os-release b/test/t/samples/fedora24/etc/os-release index f962ae641..f962ae641 100644 --- a/test/t/samples/etc.fedora24/os-release +++ b/test/t/samples/fedora24/etc/os-release |