Skip to content

Commit

Permalink
Merge pull request ElektraInitiative#2340 from ElektraInitiative/gete…
Browse files Browse the repository at this point in the history
…nv-test

tests: check getenv
  • Loading branch information
markus2330 committed Jul 27, 2019
2 parents 15a6042 + 61ef552 commit 09ef913
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions doc/news/_preparation_next_release.md
Expand Up @@ -490,6 +490,7 @@ you up to date with the multi-language support provided by Elektra.
- `kdb mount` avoid adding sync if sync is already provided. _(Markus Raab)_
- `kdb list-tools` now supports `KDB_EXEC_PATH` environment variables that contain spaces. _(René Schwaiger)_
- `gen-gpg-testkey` is added to the default tools list (see [#2668](https://github.com/ElektraInitiative/libelektra/issues/2668))._(Peter Nirschl)_
- `kdb getenv` now executed correctly from within tests _(Markus Raab)_
- <<TODO>>

- <<TODO>>
Expand Down
12 changes: 6 additions & 6 deletions tests/shell/include_common.sh.in
Expand Up @@ -58,7 +58,11 @@ DATE=$(date "+%b %d %H:%M")
KDB_DEFAULT_STORAGE="@KDB_DEFAULT_STORAGE@"
KDB_DEFAULT_RESOLVER="@KDB_DEFAULT_RESOLVER@"

KDB_GETENV=$(kdb elektrify-getenv getenv KDB 2> /dev/null)
if [ -z "${KDB}" ]; then
KDB=$({ command -v kdb || command -v kdb-full || command -v kdb-static; } | sed -nE 's/.*(kdb-?[a-z]*)$/\1/p')
fi

KDB_GETENV=$("$KDB" elektrify-getenv getenv KDB 2> /dev/null)

if [ "${KDB_GETENV}" ]; then
KDB=${KDB_GETENV}
Expand Down Expand Up @@ -131,7 +135,7 @@ SO_VERSION="@SO_VERSION@"
check_version() {
echo "Check if script tests the correct version"

if [ "x$(kdb elektrify-getenv getenv CHECK_VERSION 2> /dev/null)" = "xNO" ]; then
if [ "x$("$KDB" elektrify-getenv getenv CHECK_VERSION 2> /dev/null)" = "xNO" ]; then
return 0
fi

Expand Down Expand Up @@ -993,8 +997,4 @@ export_check() {
#
#
#
#
#
#
#
# empty lines up to 1000 so that line numbers in the resulting scripts are more useful

0 comments on commit 09ef913

Please sign in to comment.