[PATCH 4/5] Add a way to get default settings when running the kickstart_tests.

Chris Lumens clumens at redhat.com
Fri Sep 11 17:12:50 UTC 2015


This means we can get rid of some of the big block of environment
variable setting in jenkins by moving it into a config file.
---
 tests/kickstart_tests/scripts/defaults.sh            |  6 ++++++
 tests/kickstart_tests/scripts/run_kickstart_tests.sh | 12 ++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 tests/kickstart_tests/scripts/defaults.sh

diff --git a/tests/kickstart_tests/scripts/defaults.sh b/tests/kickstart_tests/scripts/defaults.sh
new file mode 100644
index 0000000..a3435ef
--- /dev/null
+++ b/tests/kickstart_tests/scripts/defaults.sh
@@ -0,0 +1,6 @@
+# Default settings that work for everyone, but may not be optimal.
+
+# Where's the package repo for tests that don't care about testing the package
+# source.  This may be slow (especially for large numbers of tests) and you may
+# want to define your own.
+export KSTEST_URL='--mirror=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-rawhide\\&arch=$basearch'
diff --git a/tests/kickstart_tests/scripts/run_kickstart_tests.sh b/tests/kickstart_tests/scripts/run_kickstart_tests.sh
index ad9cdf1..9664d6f 100755
--- a/tests/kickstart_tests/scripts/run_kickstart_tests.sh
+++ b/tests/kickstart_tests/scripts/run_kickstart_tests.sh
@@ -93,6 +93,18 @@ fi
 
 shift $((OPTIND - 1))
 
+# Get default settings from a couple different places - under the source
+# directory for settings that are potentially useful to everyone, and then
+# in the user's home directory for settings that are site-specific and thus
+# can't be put into source control.
+if [[ -e kickstart_tests/scripts/defaults.sh ]]; then
+    . kickstart_tests/scripts/defaults.sh
+fi
+
+if [[ -e $HOME/.kstests.defaults.sh ]]; then
+    . $HOME/.kstests.defaults.sh
+fi
+
 # Build up a list of substitutions to perform on kickstart files.
 sed_args=$(printenv | while read line; do
     key="$(echo $line | cut -d'=' -f1)"
-- 
2.4.3



More information about the anaconda-patches mailing list