From 930b1c89fc67d2c494868e3a6c23aece063baa1d Mon Sep 17 00:00:00 2001 From: Manuel Montecelo Date: Fri, 11 Jun 2021 15:46:43 +0200 Subject: [PATCH] TT#105151 Reverse to check that grub config does *not* contain net.ifnames=0 Change-Id: If174826b6d8398a45b1ec12b1ccaa47ba879c8b2 --- helper/compare_dbs.pl | 32 ++++++++++++++++--- sbin/ngcp-mysql-compare-dbs | 18 ++++++++++- .../830_network-interfaces-legacy.yaml.tt2 | 2 +- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/helper/compare_dbs.pl b/helper/compare_dbs.pl index ad0b95f..8a6c9b3 100755 --- a/helper/compare_dbs.pl +++ b/helper/compare_dbs.pl @@ -21,13 +21,31 @@ use Carp; my @diff_exceptions = qw( views/ldap/ldap_entries/view_definition ); -my @missing_sp1_exceptions = qw(); +my @missing_sp1_exceptions = qw( + tables/prosody/prosodyarchive + columns/prosody/prosodyarchive_host + columns/prosody/prosodyarchive_key + columns/prosody/prosodyarchive_sort_id + columns/prosody/prosodyarchive_store + columns/prosody/prosodyarchive_type + columns/prosody/prosodyarchive_user + columns/prosody/prosodyarchive_value + columns/prosody/prosodyarchive_when + columns/prosody/prosodyarchive_with + indexes/prosody/prosodyarchive_PRIMARY_1 + indexes/prosody/prosodyarchive_prosodyarchive_index_1 + indexes/prosody/prosodyarchive_prosodyarchive_index_2 + indexes/prosody/prosodyarchive_prosodyarchive_index_3 + indexes/prosody/prosodyarchive_prosodyarchive_index_4 +); my @missing_sp2_exceptions = qw(); my $credentials_file = '/etc/mysql/sipwise_extra.cnf'; my $argv = { formatter => '', schemes => '', + host_db1 => 'sp1', + host_db2 => 'sp2', pass_db1 => '', pass_db2 => '', user_db1 => '', @@ -155,18 +173,18 @@ if ($argv->{schemes} eq '') { } my $dbh1 = DBI->connect( - "DBI:mysql:;host=sp1;mysql_read_default_file=$credentials_file", + "DBI:mysql:;host=$argv->{host_db1};mysql_read_default_file=$credentials_file", $argv->{user_db1}, $argv->{pass_db1}, { RaiseError => 1 } ) or - croak("Can't connect to db1: DBI:mysql:;host=sp1;mysql_read_default_file=$credentials_file, $argv->{user_db1}, $argv->{pass_db1} "); + croak("Can't connect to db1: DBI:mysql:;host=$argv->{host_db1};mysql_read_default_file=$credentials_file, $argv->{user_db1}, $argv->{pass_db1} "); my $dbh2 = DBI->connect( - "DBI:mysql:;host=sp2;mysql_read_default_file=$credentials_file", + "DBI:mysql:;host=$argv->{host_db2};mysql_read_default_file=$credentials_file", $argv->{user_db2}, $argv->{pass_db2}, { RaiseError => 1 } ) or - croak("Can't connect to db2: DBI:mysql:;host=sp2;mysql_read_default_file=$credentials_file, $argv->{user_db2}, $argv->{pass_db2} "); + croak("Can't connect to db2: DBI:mysql:;host=$argv->{host_db2};mysql_read_default_file=$credentials_file, $argv->{user_db2}, $argv->{pass_db2} "); my $res = []; my $exit = 0; @@ -200,6 +218,10 @@ sub get_options { GetOptions( 'formatter=s' => \$argv->{'formatter'}, 'schemes=s' => \$argv->{'schemes'}, + 'host_db1=s' => \$argv->{'host_db1'}, + 'host_db2=s' => \$argv->{'host_db2'}, + 'host1=s' => \$argv->{'host_db1'}, + 'host2=s' => \$argv->{'host_db2'}, 'user_db1=s' => \$argv->{'user_db1'}, 'pass_db1=s' => \$argv->{'pass_db1'}, 'user_db2=s' => \$argv->{'user_db2'}, diff --git a/sbin/ngcp-mysql-compare-dbs b/sbin/ngcp-mysql-compare-dbs index 04c3fc7..e55c5b5 100755 --- a/sbin/ngcp-mysql-compare-dbs +++ b/sbin/ngcp-mysql-compare-dbs @@ -19,8 +19,10 @@ __USAGE__ } FORMATTER='' +HOST1='' +HOST2='' -args=$(getopt -n "$(basename "$0")" -o h -l help,formatter: -- "$@") +args=$(getopt -n "$(basename "$0")" -o h -l help,formatter:,host1:,host2: -- "$@") eval set -- "${args}" while true; do case "${1}" in @@ -28,6 +30,14 @@ while true; do FORMATTER="${2}" shift 2 ;; + --host1) + HOST1="${2}" + shift 2 + ;; + --host2) + HOST2="${2}" + shift 2 + ;; -h|--help) usage exit 0 @@ -60,6 +70,12 @@ declare -a opts if [[ -n "${FORMATTER}" ]]; then opts+=(--formatter="${FORMATTER}") fi +if [[ -n "${HOST1}" ]]; then + opts+=(--host_db1="${HOST1}") +fi +if [[ -n "${HOST2}" ]]; then + opts+=(--host_db2="${HOST2}") +fi /usr/share/ngcp-system-tests/compare_dbs.pl \ --schemes="${NGCP_DB_BACKUP_FINAL_LIST[*]}" \ "${opts[@]}" || true diff --git a/templates/830_network-interfaces-legacy.yaml.tt2 b/templates/830_network-interfaces-legacy.yaml.tt2 index 77abe59..2560b64 100644 --- a/templates/830_network-interfaces-legacy.yaml.tt2 +++ b/templates/830_network-interfaces-legacy.yaml.tt2 @@ -6,7 +6,7 @@ file: owner: root group: root filetype: file - contains: ['/^GRUB_CMDLINE_LINUX_DEFAULT=".*net.ifnames=0.*"/'] + contains: ['!/^GRUB_CMDLINE_LINUX_DEFAULT=".*net.ifnames=0.*"/'] command: