diff options
author | Pavel Raiskup <praiskup@redhat.com> | 2015-11-20 14:08:57 +0100 |
---|---|---|
committer | Pavel Raiskup <praiskup@redhat.com> | 2015-11-20 14:08:57 +0100 |
commit | 2bbcabf92610a475a93e0b75f28fd82e9953484b (patch) | |
tree | 5e61a8c9a6ad5a9440f3485c8fdc6e639be7ae4f /share/dtf | |
parent | 872193e6a71f79646cb5b289cbbd26d453b4a443 (diff) | |
download | dtf-2bbcabf92610a475a93e0b75f28fd82e9953484b.tar.gz dtf-2bbcabf92610a475a93e0b75f28fd82e9953484b.tar.xz dtf-2bbcabf92610a475a93e0b75f28fd82e9953484b.zip |
tests-api: new api dtf_assert_right_distro
* share/dtf/lib/tests (dtf_assert_right_distro): New API function
used to detect that 'dg' was run with right --distro flag.
Diffstat (limited to 'share/dtf')
-rw-r--r-- | share/dtf/lib/tests | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/share/dtf/lib/tests b/share/dtf/lib/tests index d2d57b1..e5797d1 100644 --- a/share/dtf/lib/tests +++ b/share/dtf/lib/tests @@ -41,6 +41,26 @@ dtf_debug () } +dtf_assert_right_distro () +{ + _d_distro='{{ config.os.id }}' + _d_distroversion='{{ config.os.version }}' + _d_expected=$_d_distro-$_d_distroversion + + case $_d_expected in + fedora-*|rhel-7*) + test -f /etc/os-release || dtf_fail "/etc/os-release not found!" + _d_real=$(. /etc/os-release ; echo "$ID-$VERSION_ID" ; ) + test "$_d_real" = "$_d_expected" \ + || dtf_fail "/etc/os-release is wong: $_d_real vs $_d_expected" + ;; + *) + dtf_fail "dtf_assert_right_distro () is not implemented here" + ;; + esac +} + + __dtf_debug () { dtf_debug dtf_lib "$*" |