diff --git a/linux-tools/authconfig/authconfig-test.sh b/linux-tools/authconfig/authconfig-test.sh index e53ba47d9..ebc8f1821 100755 --- a/linux-tools/authconfig/authconfig-test.sh +++ b/linux-tools/authconfig/authconfig-test.sh @@ -212,6 +212,8 @@ function test_winbind() grep "USEWINBINDAUTH" /etc/sysconfig/authconfig | grep -q "no" tc_pass_or_fail $? "test --disablewinbindauth failed" + tc_check_package samba + if [ $? -eq 0 ]; then #Test smbsecurity types local smb_security_types="user server domain ads" for types in $smb_security_types; do @@ -239,6 +241,10 @@ function test_winbind() authconfig --test 1>$stdout 2>$stderr grep "SMB workgroup" $stdout | grep -q "TESTGROUP" tc_pass_or_fail $? "test --smbworkgroup failed" + + else + tc_info "skipped samba related tests as Samba package is not installed" + fi } function test_hesiod() diff --git a/linux-tools/oddjob/oddjob.sh b/linux-tools/oddjob/oddjob.sh index 2c4ff0a9e..66bbef093 100755 --- a/linux-tools/oddjob/oddjob.sh +++ b/linux-tools/oddjob/oddjob.sh @@ -37,12 +37,12 @@ ODDJOB_CMDDIR="${LTPBIN%/shared}/oddjob/tests/cmdparse" function tc_local_setup() { # Check Installation - tc_check_package oddjob - tc_break_if_bad $? "oddjob required, but not installed" || return + tc_check_package oddjob + tc_break_if_bad $? "oddjob required, but not installed" || return cp $TESTDIR/tests/test-oddjobd.sh $TESTDIR/tests/test-oddjobd.sh.bkp sed -e 's/break/exit 1/g' -e '/exit 0/d' -i $TESTDIR/tests/test-oddjobd.sh - tc_check_package oddjob + pkgname=$(tc_print_package_version oddjob) cp $TESTDIR/tests/test-oddjobd.conf $TESTDIR/tests/test-oddjobd.conf.bkp sed -e 's|/builddir/build/BUILD/'$pkgname'/tests/|'$ODDJOB_TESTDIR'|g' -e 's/"mockbuild"/"root"/' -i $TESTDIR/tests/test-oddjobd.conf sed -e 's|\(^[0-9].*\)|0|g' -e 's|mockbuild|root|g' -i $TESTDIR/tests/006/expected_stdout diff --git a/linux-tools/shared/tc_utils.source b/linux-tools/shared/tc_utils.source index 09534b06f..de81890b7 100755 --- a/linux-tools/shared/tc_utils.source +++ b/linux-tools/shared/tc_utils.source @@ -2586,3 +2586,20 @@ function tc_check_package() rc=$? return $rc } + +################################################### +# Function to print package name and version +################################################### +function tc_print_package_version() +{ + local package=$1 + # check for Ubuntu OS + grep -i "ubuntu" /etc/*-release >/dev/null 2>&1 + if [ $? -eq 0 ];then # Start of OS check + dpkg --list| grep $package + else + rpm -q $package | sed -En "/$package-[0-9].*/p" + fi +} + +