Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifed existing code to work on ubuntu environment. #120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion linux-tools/acl/acl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ function runtest()
#$TESTDIR/run $cmd >$stdout 2>$stderr
cd $TESTDIR
./run $cmd >$stdout 2>$stderr
tc_fail_if_bad $? "unexpected response" || return
RC=$?
[ $RC -eq 0 ] && tc_ignore_warnings "Unescaped left brace in regex is deprecated, passed through"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to me that this error comes from perl ( version 5.22 ) and this is fixed in later version of perl.
And it can be fixed by escaping '{'. Can you please verify if this needs to ignored only for this version of perl ?

Please modify summary to be more precise on the changes.
For each of the changes, better to add in the comments on why it is happening in ubuntu environment specifically. like package/environment changes ?

tc_fail_if_bad $RC "unexpected response" || return
cd ..
set $(cat $stdout | grep "passed, 0 failed)" | wc -l)
[ $1 -eq 1 ]
Expand Down
6 changes: 5 additions & 1 deletion linux-tools/gawk/gawk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ function runtest()
tc_register "$tst"

srcdir=. PATH_SEPARATOR=: make -f Makefile.am $tst >$stdout 2>$stderr
tc_pass_or_fail $?
RC=$?
if [ $tst = "fnamedat" ] || [ $tst = "fnarray" ] || [ $tst = "fnarray2" ] || [ $tst = "fnarydel" ] || [ $tst = "fnasgnm" ] || [ $tst = "fnparydl" ] || [ $tst = "funsmnam" ] || [ $tst = "gsubasgn" ] || [ $tst = "parseme" ] || [ $tst = "badargs" ] || [ $tst = "match2" ] && [ $RC -eq 0 ]; then
tc_ignore_warnings "make:"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tc_ignore_warnings "make:" and tc_ignore_warnings "ar:"
This will result in ignoring anything with "make/ar" ( which may be an error and we may miss ) in future. So makes sense to use proper warning messages instead of using just "make" or "ar" .

tc_pass_or_fail $RC
rm -f _$tst
}

Expand Down
4 changes: 3 additions & 1 deletion linux-tools/libtool/libtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ function test02(){
let TST_TOTAL=$TST_TOTAL+1
tc_register "libtool: linking library: foo.lo, hello.lo --> libhello.la"
$LIBTOOL --mode=link --tag=CC $GCC -g -O -o libhello.la foo.lo hello.lo -rpath $TCTMP/libs -lm >$stdout 2>$stderr
tc_pass_or_fail $? "linking library libhello.la failed"
RC=$?
[ $RC -eq 0 ] && tc_ignore_warnings "ar:"
tc_pass_or_fail $RC "linking library libhello.la failed"
}

#
Expand Down
1 change: 1 addition & 0 deletions linux-tools/libxml2/libxml2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function TC_libxml2()
if [ $? == 1 ]; then
cat /dev/null > $stderr
fi
[ $? -eq 0 ] && tc_ignore_multiple_warnings "Missing result file result/errors/"
tc_pass_or_fail $? "libxml2 runtest failure"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct above to use right error code.

}

Expand Down
7 changes: 6 additions & 1 deletion linux-tools/ltrace/ltrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ function test07()
tc_register "ltrace -L -S command"
ltrace -L -S ./ltracetest1 &>$stdout
tc_fail_if_bad $? "ltrace -L -S command failed" || return
grep -q "open@SYS" $stdout
grep -i "ubuntu" /etc/*-release >/dev/null 2>&1
if [ $? -eq 0 ];then
grep -q "SYS_open" $stdout
else
grep -q "open@SYS" $stdout
fi
tc_pass_or_fail $? "ltrace -L -S command failed"
}

Expand Down
15 changes: 13 additions & 2 deletions linux-tools/mlocate/locate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,25 @@ function tc_local_setup()
touch $locate_this

# temporarily stop cron process
tc_service_stop_and_wait crond
grep -i "ubuntu" /etc/*-release >/dev/null 2>&1
rc=$?
if [ $rc -eq 0 ];then
tc_service_stop_and_wait cron
else
tc_service_stop_and_wait crond
fi
cron_stopped="yes"
return 0
}

function tc_local_cleanup()
{
[ "$cron_stopped" = "yes" ] && tc_service_start_and_wait crond
if [ $rc -eq 0 ];then
[ "$cron_stopped" = "yes" ] && tc_service_start_and_wait cron
else
[ "$cron_stopped" = "yes" ] && tc_service_start_and_wait crond
fi

}

#
Expand Down