2016-01-11 02:30:51 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# VmTest.pm - Vm constants and data
|
|
|
|
####################################################################################################################################
|
2016-04-14 15:30:54 +02:00
|
|
|
package pgBackRestTest::Common::VmTest;
|
2016-01-11 02:30:51 +02:00
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Perl includes
|
|
|
|
####################################################################################################################################
|
|
|
|
use strict;
|
|
|
|
use warnings FATAL => qw(all);
|
|
|
|
use Carp qw(confess);
|
|
|
|
|
|
|
|
use Exporter qw(import);
|
|
|
|
our @EXPORT = qw();
|
|
|
|
|
2020-03-10 21:41:56 +02:00
|
|
|
use pgBackRestDoc::Common::Exception;
|
|
|
|
use pgBackRestDoc::Common::Log;
|
2021-05-03 22:31:27 +02:00
|
|
|
use pgBackRestDoc::Common::String;
|
2020-03-10 21:12:44 +02:00
|
|
|
|
|
|
|
use pgBackRestTest::Common::DbVersion;
|
2016-06-24 14:12:58 +02:00
|
|
|
|
2016-05-24 14:17:13 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# VM hash keywords
|
|
|
|
####################################################################################################################################
|
2017-11-19 03:14:14 +02:00
|
|
|
use constant VM_ARCH => 'arch';
|
|
|
|
push @EXPORT, qw(VM_ARCH);
|
2016-06-12 15:00:16 +02:00
|
|
|
use constant VM_DB => 'db';
|
|
|
|
push @EXPORT, qw(VM_DB);
|
2017-06-27 21:48:34 +02:00
|
|
|
use constant VM_DB_TEST => 'db-test';
|
|
|
|
push @EXPORT, qw(VM_DB_TEST);
|
2018-05-18 12:45:14 +02:00
|
|
|
use constant VMDEF_DEBUG_INTEGRATION => 'debug-integration';
|
|
|
|
push @EXPORT, qw(VMDEF_DEBUG_INTEGRATION);
|
2021-10-14 01:48:41 +02:00
|
|
|
use constant VM_CONTROL_MTR => 'control-mtr';
|
|
|
|
push @EXPORT, qw(VM_CONTROL_MTR);
|
2018-09-15 19:27:06 +02:00
|
|
|
# Will coverage testing be run for C?
|
|
|
|
use constant VMDEF_COVERAGE_C => 'coverage-c';
|
2017-06-24 16:59:00 +02:00
|
|
|
use constant VM_DEPRECATED => 'deprecated';
|
|
|
|
push @EXPORT, qw(VM_DEPRECATED);
|
2016-05-24 14:17:13 +02:00
|
|
|
use constant VM_IMAGE => 'image';
|
|
|
|
push @EXPORT, qw(VM_IMAGE);
|
|
|
|
use constant VM_OS_BASE => 'os-base';
|
|
|
|
push @EXPORT, qw(VM_OS_BASE);
|
|
|
|
use constant VM_OS_REPO => 'os-repo';
|
|
|
|
push @EXPORT, qw(VM_OS_REPO);
|
2016-06-12 15:00:16 +02:00
|
|
|
use constant VMDEF_PGSQL_BIN => 'pgsql-bin';
|
|
|
|
push @EXPORT, qw(VMDEF_PGSQL_BIN);
|
2019-11-23 02:25:49 +02:00
|
|
|
use constant VMDEF_LCOV_VERSION => 'lcov-version';
|
|
|
|
push @EXPORT, qw(VMDEF_LCOV_VERSION);
|
2018-05-18 12:45:14 +02:00
|
|
|
use constant VMDEF_WITH_BACKTRACE => 'with-backtrace';
|
|
|
|
push @EXPORT, qw(VMDEF_WITH_BACKTRACE);
|
2020-03-10 20:45:27 +02:00
|
|
|
use constant VMDEF_WITH_LZ4 => 'with-lz4';
|
|
|
|
push @EXPORT, qw(VMDEF_WITH_LZ4);
|
2020-05-04 21:25:27 +02:00
|
|
|
use constant VMDEF_WITH_ZST => 'with-zst';
|
|
|
|
push @EXPORT, qw(VMDEF_WITH_ZST);
|
2016-05-24 14:17:13 +02:00
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Valid OS base List
|
|
|
|
####################################################################################################################################
|
|
|
|
use constant VM_OS_BASE_DEBIAN => 'debian';
|
|
|
|
push @EXPORT, qw(VM_OS_BASE_DEBIAN);
|
|
|
|
use constant VM_OS_BASE_RHEL => 'rhel';
|
|
|
|
push @EXPORT, qw(VM_OS_BASE_RHEL);
|
|
|
|
|
2017-11-19 03:14:14 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Valid architecture list
|
|
|
|
####################################################################################################################################
|
2022-01-26 21:22:31 +02:00
|
|
|
use constant VM_ARCH_AARCH64 => 'aarch64';
|
|
|
|
push @EXPORT, qw(VM_ARCH_AARCH64);
|
2017-11-19 03:14:14 +02:00
|
|
|
use constant VM_ARCH_I386 => 'i386';
|
|
|
|
push @EXPORT, qw(VM_ARCH_I386);
|
|
|
|
use constant VM_ARCH_AMD64 => 'amd64';
|
|
|
|
push @EXPORT, qw(VM_ARCH_AMD64);
|
|
|
|
|
2016-05-24 14:17:13 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Valid VM list
|
|
|
|
####################################################################################################################################
|
2017-01-10 03:49:04 +02:00
|
|
|
use constant VM_ALL => 'all';
|
|
|
|
push @EXPORT, qw(VM_ALL);
|
|
|
|
|
2019-10-08 18:06:30 +02:00
|
|
|
use constant VM_NONE => 'none';
|
|
|
|
push @EXPORT, qw(VM_NONE);
|
|
|
|
|
2021-10-28 21:15:49 +02:00
|
|
|
use constant VM_RH7 => 'rh7';
|
|
|
|
push @EXPORT, qw(VM_RH7);
|
|
|
|
use constant VM_RH8 => 'rh8';
|
|
|
|
push @EXPORT, qw(VM_RH8);
|
2021-07-18 23:29:20 +02:00
|
|
|
use constant VM_F33 => 'f33';
|
|
|
|
push @EXPORT, qw(VM_F33);
|
2018-06-06 21:52:28 +02:00
|
|
|
use constant VM_U18 => 'u18';
|
|
|
|
push @EXPORT, qw(VM_U18);
|
2021-04-08 20:38:20 +02:00
|
|
|
use constant VM_U20 => 'u20';
|
|
|
|
push @EXPORT, qw(VM_U20);
|
2017-06-28 00:29:48 +02:00
|
|
|
use constant VM_D9 => 'd9';
|
|
|
|
push @EXPORT, qw(VM_D9);
|
2016-01-11 02:30:51 +02:00
|
|
|
|
2019-02-23 15:13:23 +02:00
|
|
|
# VM aliases for run matrices (numbered oldest to newest)
|
2021-10-16 18:33:31 +02:00
|
|
|
use constant VM2 => VM_D9;
|
2019-02-23 15:13:23 +02:00
|
|
|
push @EXPORT, qw(VM2);
|
2021-10-28 21:15:49 +02:00
|
|
|
use constant VM3 => VM_RH7;
|
2019-02-23 15:13:23 +02:00
|
|
|
push @EXPORT, qw(VM3);
|
2021-07-18 23:29:20 +02:00
|
|
|
use constant VM4 => VM_U20;
|
2019-02-23 15:13:23 +02:00
|
|
|
push @EXPORT, qw(VM4);
|
|
|
|
|
2019-10-08 18:06:30 +02:00
|
|
|
# List of default test VMs
|
2020-12-02 23:23:05 +02:00
|
|
|
use constant VM_LIST => (VM2, VM3, VM4);
|
2017-02-18 05:31:16 +02:00
|
|
|
push @EXPORT, qw(VM_LIST);
|
|
|
|
|
2016-01-11 02:30:51 +02:00
|
|
|
my $oyVm =
|
|
|
|
{
|
2019-10-08 18:06:30 +02:00
|
|
|
# None
|
|
|
|
&VM_NONE =>
|
|
|
|
{
|
2019-10-12 15:45:18 +02:00
|
|
|
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
|
2019-10-08 18:06:30 +02:00
|
|
|
&VM_ARCH => VM_ARCH_AMD64,
|
|
|
|
&VMDEF_COVERAGE_C => true,
|
2019-10-12 15:45:18 +02:00
|
|
|
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
2019-10-08 18:06:30 +02:00
|
|
|
|
2020-05-04 21:25:27 +02:00
|
|
|
&VMDEF_WITH_ZST => true,
|
|
|
|
|
2019-10-08 18:06:30 +02:00
|
|
|
&VM_DB =>
|
|
|
|
[
|
|
|
|
PG_VERSION_10,
|
|
|
|
],
|
|
|
|
|
|
|
|
&VM_DB_TEST =>
|
|
|
|
[
|
|
|
|
PG_VERSION_10,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2021-10-28 21:15:49 +02:00
|
|
|
# RHEL 7
|
|
|
|
&VM_RH7 =>
|
2016-01-11 02:30:51 +02:00
|
|
|
{
|
2016-05-24 14:17:13 +02:00
|
|
|
&VM_OS_BASE => VM_OS_BASE_RHEL,
|
|
|
|
&VM_IMAGE => 'centos:7',
|
2017-11-19 03:14:14 +02:00
|
|
|
&VM_ARCH => VM_ARCH_AMD64,
|
2016-06-12 15:00:16 +02:00
|
|
|
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
|
2016-05-24 14:17:13 +02:00
|
|
|
|
2018-05-18 12:45:14 +02:00
|
|
|
&VMDEF_DEBUG_INTEGRATION => false,
|
2020-05-04 21:25:27 +02:00
|
|
|
&VMDEF_WITH_ZST => true,
|
2018-05-18 12:45:14 +02:00
|
|
|
|
2016-06-12 15:00:16 +02:00
|
|
|
&VM_DB =>
|
2018-07-21 23:02:42 +02:00
|
|
|
[
|
|
|
|
PG_VERSION_95,
|
|
|
|
PG_VERSION_96,
|
|
|
|
PG_VERSION_10,
|
2019-10-12 17:26:13 +02:00
|
|
|
PG_VERSION_11,
|
|
|
|
PG_VERSION_12,
|
2020-09-24 17:19:51 +02:00
|
|
|
PG_VERSION_13,
|
2018-07-21 23:02:42 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
&VM_DB_TEST =>
|
2016-05-14 16:33:12 +02:00
|
|
|
[
|
2016-05-24 14:17:13 +02:00
|
|
|
PG_VERSION_96,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2021-07-18 23:29:20 +02:00
|
|
|
# Fedora 33
|
|
|
|
&VM_F33 =>
|
2019-10-09 21:03:03 +02:00
|
|
|
{
|
|
|
|
&VM_OS_BASE => VM_OS_BASE_RHEL,
|
2021-07-18 23:29:20 +02:00
|
|
|
&VM_IMAGE => 'fedora:33',
|
2019-10-09 21:03:03 +02:00
|
|
|
&VM_ARCH => VM_ARCH_AMD64,
|
|
|
|
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
|
2020-03-20 19:49:23 +02:00
|
|
|
&VMDEF_COVERAGE_C => true,
|
2019-10-09 21:03:03 +02:00
|
|
|
|
|
|
|
&VMDEF_DEBUG_INTEGRATION => false,
|
2020-05-04 21:25:27 +02:00
|
|
|
&VMDEF_WITH_ZST => true,
|
2019-10-09 21:03:03 +02:00
|
|
|
|
|
|
|
&VM_DB =>
|
|
|
|
[
|
|
|
|
PG_VERSION_96,
|
|
|
|
PG_VERSION_10,
|
|
|
|
PG_VERSION_11,
|
|
|
|
PG_VERSION_12,
|
2021-07-18 23:29:20 +02:00
|
|
|
PG_VERSION_13,
|
2019-10-09 21:03:03 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
&VM_DB_TEST =>
|
|
|
|
[
|
2020-05-07 17:06:56 +02:00
|
|
|
PG_VERSION_12,
|
2019-10-09 21:03:03 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2017-06-28 00:29:48 +02:00
|
|
|
# Debian 9
|
|
|
|
&VM_D9 =>
|
|
|
|
{
|
|
|
|
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
|
|
|
|
&VM_OS_REPO => 'stretch',
|
2021-10-16 18:33:31 +02:00
|
|
|
&VM_IMAGE => 'i386/debian:9',
|
2021-07-18 23:29:20 +02:00
|
|
|
&VM_ARCH => VM_ARCH_I386,
|
2016-06-12 15:00:16 +02:00
|
|
|
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
2016-05-24 14:17:13 +02:00
|
|
|
|
2018-06-06 21:52:28 +02:00
|
|
|
&VM_DB =>
|
|
|
|
[
|
2021-07-18 23:29:20 +02:00
|
|
|
PG_VERSION_90,
|
2018-07-21 23:02:42 +02:00
|
|
|
PG_VERSION_91,
|
|
|
|
PG_VERSION_92,
|
2018-06-06 21:52:28 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
&VM_DB_TEST =>
|
|
|
|
[
|
2021-07-18 23:29:20 +02:00
|
|
|
PG_VERSION_90,
|
2022-05-09 20:19:05 +02:00
|
|
|
PG_VERSION_91,
|
|
|
|
PG_VERSION_92,
|
2018-06-06 21:52:28 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
# Ubuntu 18.04
|
|
|
|
&VM_U18 =>
|
|
|
|
{
|
|
|
|
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
|
|
|
|
&VM_OS_REPO => 'bionic',
|
|
|
|
&VM_IMAGE => 'ubuntu:18.04',
|
|
|
|
&VM_ARCH => VM_ARCH_AMD64,
|
2018-09-15 19:27:06 +02:00
|
|
|
&VMDEF_COVERAGE_C => true,
|
2018-06-06 21:52:28 +02:00
|
|
|
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
|
|
|
|
|
|
|
&VMDEF_WITH_BACKTRACE => true,
|
2020-05-04 21:25:27 +02:00
|
|
|
&VMDEF_WITH_ZST => true,
|
2018-06-06 21:52:28 +02:00
|
|
|
|
2016-06-12 15:00:16 +02:00
|
|
|
&VM_DB =>
|
2016-05-24 14:17:13 +02:00
|
|
|
[
|
2020-09-24 17:19:51 +02:00
|
|
|
PG_VERSION_90,
|
|
|
|
PG_VERSION_91,
|
|
|
|
PG_VERSION_92,
|
2018-07-21 23:02:42 +02:00
|
|
|
PG_VERSION_93,
|
2017-06-27 21:58:02 +02:00
|
|
|
PG_VERSION_94,
|
2017-09-01 18:29:34 +02:00
|
|
|
PG_VERSION_95,
|
2018-07-21 23:02:42 +02:00
|
|
|
PG_VERSION_96,
|
2017-09-01 18:29:34 +02:00
|
|
|
PG_VERSION_10,
|
2018-06-05 14:59:17 +02:00
|
|
|
PG_VERSION_11,
|
2019-09-27 15:35:59 +02:00
|
|
|
PG_VERSION_12,
|
2020-05-21 19:46:16 +02:00
|
|
|
PG_VERSION_13,
|
2017-09-01 18:29:34 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
&VM_DB_TEST =>
|
|
|
|
[
|
2020-12-09 22:19:01 +02:00
|
|
|
PG_VERSION_93,
|
2020-05-05 21:00:13 +02:00
|
|
|
PG_VERSION_94,
|
2020-12-02 23:23:05 +02:00
|
|
|
PG_VERSION_95,
|
|
|
|
PG_VERSION_10,
|
2018-06-05 14:59:17 +02:00
|
|
|
PG_VERSION_11,
|
2019-10-01 19:20:43 +02:00
|
|
|
PG_VERSION_12,
|
2020-05-21 19:46:16 +02:00
|
|
|
PG_VERSION_13,
|
2016-05-14 16:33:12 +02:00
|
|
|
],
|
|
|
|
},
|
2021-04-08 20:38:20 +02:00
|
|
|
|
|
|
|
# Ubuntu 20.04
|
|
|
|
&VM_U20 =>
|
|
|
|
{
|
|
|
|
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
|
|
|
|
&VM_OS_REPO => 'focal',
|
|
|
|
&VM_IMAGE => 'ubuntu:20.04',
|
|
|
|
&VM_ARCH => VM_ARCH_AMD64,
|
|
|
|
&VMDEF_COVERAGE_C => true,
|
|
|
|
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
|
|
|
|
|
|
|
&VMDEF_WITH_BACKTRACE => true,
|
|
|
|
&VMDEF_WITH_ZST => true,
|
|
|
|
|
|
|
|
&VM_DB =>
|
|
|
|
[
|
|
|
|
PG_VERSION_90,
|
|
|
|
PG_VERSION_91,
|
|
|
|
PG_VERSION_92,
|
|
|
|
PG_VERSION_93,
|
|
|
|
PG_VERSION_94,
|
|
|
|
PG_VERSION_95,
|
|
|
|
PG_VERSION_96,
|
|
|
|
PG_VERSION_10,
|
|
|
|
PG_VERSION_11,
|
|
|
|
PG_VERSION_12,
|
|
|
|
PG_VERSION_13,
|
2021-07-18 23:29:20 +02:00
|
|
|
PG_VERSION_14,
|
2022-05-04 17:55:59 +02:00
|
|
|
PG_VERSION_15,
|
2021-04-08 20:38:20 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
&VM_DB_TEST =>
|
|
|
|
[
|
|
|
|
PG_VERSION_93,
|
|
|
|
PG_VERSION_94,
|
|
|
|
PG_VERSION_95,
|
|
|
|
PG_VERSION_10,
|
|
|
|
PG_VERSION_11,
|
|
|
|
PG_VERSION_12,
|
|
|
|
PG_VERSION_13,
|
2021-07-18 23:29:20 +02:00
|
|
|
PG_VERSION_14,
|
2022-05-04 17:55:59 +02:00
|
|
|
PG_VERSION_15,
|
2021-04-08 20:38:20 +02:00
|
|
|
],
|
|
|
|
},
|
2016-01-11 02:30:51 +02:00
|
|
|
};
|
|
|
|
|
2017-06-27 21:48:34 +02:00
|
|
|
####################################################################################################################################
|
2019-08-26 18:05:36 +02:00
|
|
|
# Set VM_DB_TEST to VM_DB if it is not defined so it doesn't have to be checked everywhere
|
2017-06-27 21:48:34 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
foreach my $strVm (sort(keys(%{$oyVm})))
|
|
|
|
{
|
|
|
|
if (!defined($oyVm->{$strVm}{&VM_DB_TEST}))
|
|
|
|
{
|
|
|
|
$oyVm->{$strVm}{&VM_DB_TEST} = $oyVm->{$strVm}{&VM_DB};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
####################################################################################################################################
|
|
|
|
# Verify that each version of PostgreSQL is represented in one and only one default VM
|
|
|
|
####################################################################################################################################
|
|
|
|
foreach my $strPgVersion (versionSupport())
|
|
|
|
{
|
|
|
|
my $strVmPgVersionRun;
|
2018-09-15 19:27:06 +02:00
|
|
|
my $bVmCoverageC = false;
|
2017-06-27 21:48:34 +02:00
|
|
|
|
|
|
|
foreach my $strVm (VM_LIST)
|
|
|
|
{
|
2018-09-15 19:27:06 +02:00
|
|
|
if (vmCoverageC($strVm))
|
|
|
|
{
|
|
|
|
$bVmCoverageC = true;
|
|
|
|
}
|
|
|
|
|
2017-06-27 21:48:34 +02:00
|
|
|
foreach my $strVmPgVersion (@{$oyVm->{$strVm}{&VM_DB_TEST}})
|
|
|
|
{
|
|
|
|
if ($strPgVersion eq $strVmPgVersion)
|
|
|
|
{
|
|
|
|
if (defined($strVmPgVersionRun))
|
|
|
|
{
|
|
|
|
confess &log(ASSERT, "PostgreSQL $strPgVersion is already configured to run on default vm $strVm");
|
|
|
|
}
|
|
|
|
|
|
|
|
$strVmPgVersionRun = $strVm;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-19 02:53:41 +02:00
|
|
|
my $strErrorSuffix = 'is not configured to run on a default vm';
|
|
|
|
|
2018-09-15 19:27:06 +02:00
|
|
|
if (!$bVmCoverageC)
|
|
|
|
{
|
|
|
|
confess &log(ASSERT, "C coverage ${strErrorSuffix}");
|
|
|
|
}
|
|
|
|
|
2017-06-27 21:48:34 +02:00
|
|
|
if (!defined($strVmPgVersionRun))
|
|
|
|
{
|
2017-11-19 02:53:41 +02:00
|
|
|
confess &log(ASSERT, "PostgreSQL ${strPgVersion} ${strErrorSuffix}");
|
2017-06-27 21:48:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-17 14:00:18 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# vmValid
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmValid
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
|
|
|
|
if (!defined($oyVm->{$strVm}))
|
|
|
|
{
|
2020-03-09 23:41:59 +02:00
|
|
|
confess &log(ERROR, "no definition for vm '${strVm}'");
|
2019-10-17 14:00:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmValid);
|
|
|
|
|
2019-11-02 11:35:48 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Which vm to use for the test matrix. If one of the standard four, then use that, else use VM4.
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmTest
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
|
|
|
|
if (grep(/^$strVm$/, VM_LIST))
|
|
|
|
{
|
|
|
|
return $strVm;
|
|
|
|
}
|
|
|
|
|
|
|
|
return VM4;
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmTest);
|
|
|
|
|
2016-01-11 02:30:51 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# vmGet
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmGet
|
|
|
|
{
|
|
|
|
return $oyVm;
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmGet);
|
|
|
|
|
2017-04-10 18:31:30 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# vmBaseTest
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmBaseTest
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
my $strDistroTest = shift;
|
|
|
|
|
|
|
|
return $oyVm->{$strVm}{&VM_OS_BASE} eq $strDistroTest ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmBaseTest);
|
|
|
|
|
|
|
|
####################################################################################################################################
|
2018-09-15 19:27:06 +02:00
|
|
|
# vmCoverageC
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmCoverageC
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
|
|
|
|
return $oyVm->{$strVm}{&VMDEF_COVERAGE_C} ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmCoverageC);
|
|
|
|
|
2017-11-19 03:14:14 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Get vm architecture bits
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmArchBits
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
|
2022-01-26 21:22:31 +02:00
|
|
|
return ($oyVm->{$strVm}{&VM_ARCH} eq VM_ARCH_I386 ? 32 : 64);
|
2017-11-19 03:14:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmArchBits);
|
|
|
|
|
2021-05-03 22:31:27 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Get host architecture
|
|
|
|
####################################################################################################################################
|
|
|
|
my $strHostArch = undef;
|
|
|
|
|
|
|
|
sub hostArch
|
|
|
|
{
|
|
|
|
if (!defined($strHostArch))
|
|
|
|
{
|
|
|
|
$strHostArch = trim(`uname -m`);
|
|
|
|
|
|
|
|
# Mac M1 reports arm64 but we generally need aarch64 (which Linux reports)
|
|
|
|
if ($strHostArch eq 'arm64')
|
|
|
|
{
|
|
|
|
$strHostArch = 'aarch64';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $strHostArch;
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(hostArch);
|
|
|
|
|
2018-05-18 12:45:14 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Does the VM support libbacktrace?
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmWithBackTrace
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
|
|
|
|
return ($oyVm->{$strVm}{&VMDEF_WITH_BACKTRACE} ? true : false);
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmWithBackTrace);
|
|
|
|
|
2020-03-10 20:45:27 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Does the VM support liblz4?
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmWithLz4
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
|
|
|
|
return (defined($oyVm->{$strVm}{&VMDEF_WITH_LZ4}) ? $oyVm->{$strVm}{&VMDEF_WITH_LZ4} : true);
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmWithLz4);
|
|
|
|
|
2020-05-04 21:25:27 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Does the VM support liblzst?
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmWithZst
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
|
|
|
|
return (defined($oyVm->{$strVm}{&VMDEF_WITH_ZST}) ? $oyVm->{$strVm}{&VMDEF_WITH_ZST} : false);
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmWithZst);
|
|
|
|
|
2018-05-18 12:45:14 +02:00
|
|
|
####################################################################################################################################
|
|
|
|
# Will integration tests be run in debug mode?
|
|
|
|
####################################################################################################################################
|
|
|
|
sub vmDebugIntegration
|
|
|
|
{
|
|
|
|
my $strVm = shift;
|
|
|
|
|
|
|
|
return (defined($oyVm->{$strVm}{&VMDEF_DEBUG_INTEGRATION}) ? $oyVm->{$strVm}{&VMDEF_DEBUG_INTEGRATION} : true);
|
|
|
|
}
|
|
|
|
|
|
|
|
push @EXPORT, qw(vmDebugIntegration);
|
|
|
|
|
2016-01-11 02:30:51 +02:00
|
|
|
1;
|