Skip to content

Commit

Permalink
Modifed existing code to work on Ubuntu.
Browse files Browse the repository at this point in the history
ltrace - ltrace -L -S output was different in Ubuntu.
Modified script to grep for SYS_open instead of open@SYS

mlocate - crond service in Ubuntu is cron service.
Updated the wrapper to check for cron instead of crond

Signed-off-by: Rajashree Rajendran <[email protected]>
  • Loading branch information
rajashreer7 committed Sep 4, 2017
1 parent 86d3453 commit 685518e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
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

0 comments on commit 685518e

Please sign in to comment.