From 2187d7604177417a2a7a5b2665d3d33df8fcbce4 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Fri, 28 Jun 2019 12:31:19 +0200 Subject: [PATCH 1/3] [705-wipe_data-sh-and-other-upgrade_-scripts-do-not-set-prefix] Added prefix=@prefix@ and put shell bang at the right place --- src/share/database/scripts/cql/wipe_data.sh.in | 5 +++-- src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh.in | 1 + src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh.in | 1 + src/share/database/scripts/mysql/upgrade_3.0_to_4.0.sh.in | 1 + src/share/database/scripts/mysql/upgrade_4.0_to_4.1.sh.in | 1 + src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh.in | 1 + src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in | 1 + src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in | 1 + src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in | 1 + src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in | 1 + src/share/database/scripts/mysql/upgrade_7.0_to_8.0.sh.in | 1 + src/share/database/scripts/mysql/upgrade_8.0_to_8.1.sh.in | 1 + src/share/database/scripts/mysql/wipe_data.sh.in | 5 +++-- src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh.in | 1 + src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in | 1 + src/share/database/scripts/pgsql/upgrade_3.0_to_3.1.sh.in | 1 + src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in | 1 + src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in | 1 + src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in | 1 + src/share/database/scripts/pgsql/upgrade_4.0_to_5.0.sh.in | 1 + src/share/database/scripts/pgsql/wipe_data.sh.in | 5 +++-- 21 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/share/database/scripts/cql/wipe_data.sh.in b/src/share/database/scripts/cql/wipe_data.sh.in index 194300e381..03ec702ddb 100644 --- a/src/share/database/scripts/cql/wipe_data.sh.in +++ b/src/share/database/scripts/cql/wipe_data.sh.in @@ -1,17 +1,18 @@ +#!/bin/sh + # Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -#!/bin/sh - # This script is primarily used for CQL unit tests, which need to # ensure an empty, but schema correct database for each test. It # deletes ALL transient data from an existing Kea CQL schema, # including leases, reservations, etc... Use at your own peril. # Reference tables will be left in-tact. +prefix=@prefix@a # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh.in b/src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh.in index 6914f6de15..36b66aaf5a 100644 --- a/src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_1.0_to_2.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh.in b/src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh.in index 0c28330ffd..6865a3ef4b 100644 --- a/src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_2.0_to_3.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_3.0_to_4.0.sh.in b/src/share/database/scripts/mysql/upgrade_3.0_to_4.0.sh.in index 400bbaa079..84e3937808 100644 --- a/src/share/database/scripts/mysql/upgrade_3.0_to_4.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_3.0_to_4.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_4.0_to_4.1.sh.in b/src/share/database/scripts/mysql/upgrade_4.0_to_4.1.sh.in index 88d2677f64..95a99f2079 100644 --- a/src/share/database/scripts/mysql/upgrade_4.0_to_4.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_4.0_to_4.1.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh.in b/src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh.in index f63179bb3b..172622e1d8 100644 --- a/src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_4.1_to_5.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in b/src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in index 14d0ef0139..78dc4933eb 100644 --- a/src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_5.0_to_5.1.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in b/src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in index b692f69121..5e1e20a5b0 100644 --- a/src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in +++ b/src/share/database/scripts/mysql/upgrade_5.1_to_5.2.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in b/src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in index 3bf129cce4..09a7f6e1a1 100644 --- a/src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_5.2_to_6.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in b/src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in index 9c4c7c3477..47c29130ea 100644 --- a/src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_6.0_to_7.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_7.0_to_8.0.sh.in b/src/share/database/scripts/mysql/upgrade_7.0_to_8.0.sh.in index 8f2a4ebec7..a7a331bc72 100644 --- a/src/share/database/scripts/mysql/upgrade_7.0_to_8.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_7.0_to_8.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/upgrade_8.0_to_8.1.sh.in b/src/share/database/scripts/mysql/upgrade_8.0_to_8.1.sh.in index b46fed8881..78651e584f 100644 --- a/src/share/database/scripts/mysql/upgrade_8.0_to_8.1.sh.in +++ b/src/share/database/scripts/mysql/upgrade_8.0_to_8.1.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/mysql/wipe_data.sh.in b/src/share/database/scripts/mysql/wipe_data.sh.in index b2ac8b9dd2..e334af0d00 100644 --- a/src/share/database/scripts/mysql/wipe_data.sh.in +++ b/src/share/database/scripts/mysql/wipe_data.sh.in @@ -1,17 +1,18 @@ +#!/bin/sh + # Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -#!/bin/sh - # This script is primarily used for MySQL unit tests, which need to # ensure an empty, but schema correct database for each test. It # deletes ALL transient data from an existing Kea MySQL schema, # including leases, reservations, etc... Use at your own peril. # Reference tables will be left in-tact. +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh.in b/src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh.in index 22d6af4d82..f15ec6ae97 100644 --- a/src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_1.0_to_2.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in b/src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in index ac283c3c04..5f62a132b0 100644 --- a/src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_2.0_to_3.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/pgsql/upgrade_3.0_to_3.1.sh.in b/src/share/database/scripts/pgsql/upgrade_3.0_to_3.1.sh.in index 531f250b85..b05d670eae 100644 --- a/src/share/database/scripts/pgsql/upgrade_3.0_to_3.1.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_3.0_to_3.1.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in b/src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in index 3581ead644..66c9bc75bd 100644 --- a/src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_3.1_to_3.2.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in b/src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in index 76f4683ea8..069133c1d4 100644 --- a/src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_3.2_to_3.3.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in b/src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in index b9513629c0..c2b12ee639 100644 --- a/src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_3.3_to_4.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/pgsql/upgrade_4.0_to_5.0.sh.in b/src/share/database/scripts/pgsql/upgrade_4.0_to_5.0.sh.in index 243b94692a..733d7c7c6e 100644 --- a/src/share/database/scripts/pgsql/upgrade_4.0_to_5.0.sh.in +++ b/src/share/database/scripts/pgsql/upgrade_4.0_to_5.0.sh.in @@ -1,5 +1,6 @@ #!/bin/sh +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then diff --git a/src/share/database/scripts/pgsql/wipe_data.sh.in b/src/share/database/scripts/pgsql/wipe_data.sh.in index 4df8de6b05..93fb9450d5 100644 --- a/src/share/database/scripts/pgsql/wipe_data.sh.in +++ b/src/share/database/scripts/pgsql/wipe_data.sh.in @@ -1,17 +1,18 @@ +#!/bin/sh + # Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -#!/bin/sh - # This script is primarily used for MySQL unit tests, which need to # ensure an empty, but schema correct database for each test. It # deletes ALL transient data from an existing Kea MySQL schema, # including leases, reservations, etc... Use at your own peril. # Reference tables will be left in-tact. +prefix=@prefix@ # Include utilities. Use installed version if available and # use build version if it isn't. if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then -- GitLab From 5b33ae7dd208c048d5e583a151097c6c00965940 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Fri, 28 Jun 2019 13:28:38 +0200 Subject: [PATCH 2/3] [705-wipe_data-sh-and-other-upgrade_-scripts-do-not-set-prefix] Protected dhcp_test_lib.sh against unset ${prefix} and fixed includers --- src/bin/admin/tests/cql_tests.sh.in | 1 + src/bin/admin/tests/memfile_tests.sh.in | 3 ++- src/bin/admin/tests/mysql_tests.sh.in | 1 + src/bin/admin/tests/pgsql_tests.sh.in | 3 ++- src/bin/agent/tests/ca_process_tests.sh.in | 3 ++- src/bin/d2/tests/d2_process_tests.sh.in | 3 ++- src/bin/dhcp4/tests/dhcp4_process_tests.sh.in | 3 ++- src/bin/dhcp6/tests/dhcp6_process_tests.sh.in | 5 ++++- src/bin/keactrl/tests/keactrl_tests.sh.in | 1 + src/bin/netconf/tests/shtests/netconf_tests.sh.in | 5 ++++- src/bin/shell/tests/shell_process_tests.sh.in | 1 + src/lib/testutils/dhcp_test_lib.sh.in | 6 ++++++ 12 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/bin/admin/tests/cql_tests.sh.in b/src/bin/admin/tests/cql_tests.sh.in index 7fa681028a..9af1c502cc 100644 --- a/src/bin/admin/tests/cql_tests.sh.in +++ b/src/bin/admin/tests/cql_tests.sh.in @@ -6,6 +6,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/admin/tests/memfile_tests.sh.in b/src/bin/admin/tests/memfile_tests.sh.in index 682a411e0c..edc40402dc 100644 --- a/src/bin/admin/tests/memfile_tests.sh.in +++ b/src/bin/admin/tests/memfile_tests.sh.in @@ -1,11 +1,12 @@ #!/bin/sh -# Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index ecde4117e9..c39571c577 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -6,6 +6,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index 2cd660cd34..61ae078410 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -1,11 +1,12 @@ #!/bin/sh -# Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/agent/tests/ca_process_tests.sh.in b/src/bin/agent/tests/ca_process_tests.sh.in index 498e600fa8..38d220e98f 100644 --- a/src/bin/agent/tests/ca_process_tests.sh.in +++ b/src/bin/agent/tests/ca_process_tests.sh.in @@ -1,9 +1,10 @@ -# Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/agent/tests/test_config.json # Path to the Control Agent log file. diff --git a/src/bin/d2/tests/d2_process_tests.sh.in b/src/bin/d2/tests/d2_process_tests.sh.in index 6927dac2b8..7afd860b37 100644 --- a/src/bin/d2/tests/d2_process_tests.sh.in +++ b/src/bin/d2/tests/d2_process_tests.sh.in @@ -1,9 +1,10 @@ -# Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/d2/tests/test_config.json # Path to the D2 log file. diff --git a/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in b/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in index 96cba300bc..57223b3ec1 100644 --- a/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in +++ b/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in @@ -1,9 +1,10 @@ -# Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/dhcp4/tests/test_config.json # Path to the Kea log file. diff --git a/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in b/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in index ab7d419cc4..ca11496fce 100644 --- a/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in +++ b/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in @@ -1,9 +1,12 @@ -# Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC") +#!/bin/sh + +# Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/dhcp6/tests/test_config.json # Path to the Kea log file. diff --git a/src/bin/keactrl/tests/keactrl_tests.sh.in b/src/bin/keactrl/tests/keactrl_tests.sh.in index 860054b26d..2c4a31bef4 100644 --- a/src/bin/keactrl/tests/keactrl_tests.sh.in +++ b/src/bin/keactrl/tests/keactrl_tests.sh.in @@ -6,6 +6,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/netconf/tests/shtests/netconf_tests.sh.in b/src/bin/netconf/tests/shtests/netconf_tests.sh.in index 306d4e08ef..ba311b69d4 100644 --- a/src/bin/netconf/tests/shtests/netconf_tests.sh.in +++ b/src/bin/netconf/tests/shtests/netconf_tests.sh.in @@ -1,9 +1,12 @@ -# Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") +#!/bin/sh + +# Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/netconf/tests/shtests/test_config.json # Path to the Kea log file. diff --git a/src/bin/shell/tests/shell_process_tests.sh.in b/src/bin/shell/tests/shell_process_tests.sh.in index 3a9545c489..f1345e3403 100644 --- a/src/bin/shell/tests/shell_process_tests.sh.in +++ b/src/bin/shell/tests/shell_process_tests.sh.in @@ -4,6 +4,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/shell/tests/test_config.json # Path to the Control Agent log file. diff --git a/src/lib/testutils/dhcp_test_lib.sh.in b/src/lib/testutils/dhcp_test_lib.sh.in index 462522ca7e..3a8afb390d 100644 --- a/src/lib/testutils/dhcp_test_lib.sh.in +++ b/src/lib/testutils/dhcp_test_lib.sh.in @@ -803,3 +803,9 @@ server_pid_file_test() { # All ok. Shut down the server and exit. test_finish 0 } + +# Verify that prefix was set by the includer. +if [ -z ${prefix+x} ]; then + printf "internal error: \${prefix} must be set\n" + clean_exit 1 +fi -- GitLab From 1aaae966e019168c19458c324bb3b7df6c9ddd20 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Tue, 2 Jul 2019 13:27:43 +0200 Subject: [PATCH 3/3] [705-wipe_data-sh-and-other-upgrade_-scripts-do-not-set-prefix] Revert "[705-wipe_data-sh-and-other-upgrade_-scripts-do-not-set-prefix] Protected dhcp_test_lib.sh against unset ${prefix} and fixed includers" This reverts commit 7fe457cb301772093ff7002c9a3be12b25f7d73b. Reviewer asked this to be reverted as overkilling. --- src/bin/admin/tests/cql_tests.sh.in | 1 - src/bin/admin/tests/memfile_tests.sh.in | 3 +-- src/bin/admin/tests/mysql_tests.sh.in | 1 - src/bin/admin/tests/pgsql_tests.sh.in | 3 +-- src/bin/agent/tests/ca_process_tests.sh.in | 3 +-- src/bin/d2/tests/d2_process_tests.sh.in | 3 +-- src/bin/dhcp4/tests/dhcp4_process_tests.sh.in | 3 +-- src/bin/dhcp6/tests/dhcp6_process_tests.sh.in | 5 +---- src/bin/keactrl/tests/keactrl_tests.sh.in | 1 - src/bin/netconf/tests/shtests/netconf_tests.sh.in | 5 +---- src/bin/shell/tests/shell_process_tests.sh.in | 1 - src/lib/testutils/dhcp_test_lib.sh.in | 6 ------ 12 files changed, 7 insertions(+), 28 deletions(-) diff --git a/src/bin/admin/tests/cql_tests.sh.in b/src/bin/admin/tests/cql_tests.sh.in index 9af1c502cc..7fa681028a 100644 --- a/src/bin/admin/tests/cql_tests.sh.in +++ b/src/bin/admin/tests/cql_tests.sh.in @@ -6,7 +6,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/admin/tests/memfile_tests.sh.in b/src/bin/admin/tests/memfile_tests.sh.in index edc40402dc..682a411e0c 100644 --- a/src/bin/admin/tests/memfile_tests.sh.in +++ b/src/bin/admin/tests/memfile_tests.sh.in @@ -1,12 +1,11 @@ #!/bin/sh -# Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index c39571c577..ecde4117e9 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -6,7 +6,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index 61ae078410..2cd660cd34 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -1,12 +1,11 @@ #!/bin/sh -# Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/agent/tests/ca_process_tests.sh.in b/src/bin/agent/tests/ca_process_tests.sh.in index 38d220e98f..498e600fa8 100644 --- a/src/bin/agent/tests/ca_process_tests.sh.in +++ b/src/bin/agent/tests/ca_process_tests.sh.in @@ -1,10 +1,9 @@ -# Copyright (C) 2016-2019 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/agent/tests/test_config.json # Path to the Control Agent log file. diff --git a/src/bin/d2/tests/d2_process_tests.sh.in b/src/bin/d2/tests/d2_process_tests.sh.in index 7afd860b37..6927dac2b8 100644 --- a/src/bin/d2/tests/d2_process_tests.sh.in +++ b/src/bin/d2/tests/d2_process_tests.sh.in @@ -1,10 +1,9 @@ -# Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/d2/tests/test_config.json # Path to the D2 log file. diff --git a/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in b/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in index 57223b3ec1..96cba300bc 100644 --- a/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in +++ b/src/bin/dhcp4/tests/dhcp4_process_tests.sh.in @@ -1,10 +1,9 @@ -# Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/dhcp4/tests/test_config.json # Path to the Kea log file. diff --git a/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in b/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in index ca11496fce..ab7d419cc4 100644 --- a/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in +++ b/src/bin/dhcp6/tests/dhcp6_process_tests.sh.in @@ -1,12 +1,9 @@ -#!/bin/sh - -# Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/dhcp6/tests/test_config.json # Path to the Kea log file. diff --git a/src/bin/keactrl/tests/keactrl_tests.sh.in b/src/bin/keactrl/tests/keactrl_tests.sh.in index 2c4a31bef4..860054b26d 100644 --- a/src/bin/keactrl/tests/keactrl_tests.sh.in +++ b/src/bin/keactrl/tests/keactrl_tests.sh.in @@ -6,7 +6,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Include common test library. . @abs_top_builddir@/src/lib/testutils/dhcp_test_lib.sh diff --git a/src/bin/netconf/tests/shtests/netconf_tests.sh.in b/src/bin/netconf/tests/shtests/netconf_tests.sh.in index ba311b69d4..306d4e08ef 100644 --- a/src/bin/netconf/tests/shtests/netconf_tests.sh.in +++ b/src/bin/netconf/tests/shtests/netconf_tests.sh.in @@ -1,12 +1,9 @@ -#!/bin/sh - -# Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC") # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/netconf/tests/shtests/test_config.json # Path to the Kea log file. diff --git a/src/bin/shell/tests/shell_process_tests.sh.in b/src/bin/shell/tests/shell_process_tests.sh.in index f1345e3403..3a9545c489 100644 --- a/src/bin/shell/tests/shell_process_tests.sh.in +++ b/src/bin/shell/tests/shell_process_tests.sh.in @@ -4,7 +4,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -prefix=@prefix@ # Path to the temporary configuration file. CFG_FILE=@abs_top_builddir@/src/bin/shell/tests/test_config.json # Path to the Control Agent log file. diff --git a/src/lib/testutils/dhcp_test_lib.sh.in b/src/lib/testutils/dhcp_test_lib.sh.in index 3a8afb390d..462522ca7e 100644 --- a/src/lib/testutils/dhcp_test_lib.sh.in +++ b/src/lib/testutils/dhcp_test_lib.sh.in @@ -803,9 +803,3 @@ server_pid_file_test() { # All ok. Shut down the server and exit. test_finish 0 } - -# Verify that prefix was set by the includer. -if [ -z ${prefix+x} ]; then - printf "internal error: \${prefix} must be set\n" - clean_exit 1 -fi -- GitLab