Skip to content

Commit 685518e

Browse files
committed
Modifed existing code to work on Ubuntu.
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]>
1 parent 86d3453 commit 685518e

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

linux-tools/ltrace/ltrace.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ function test07()
137137
tc_register "ltrace -L -S command"
138138
ltrace -L -S ./ltracetest1 &>$stdout
139139
tc_fail_if_bad $? "ltrace -L -S command failed" || return
140-
grep -q "open@SYS" $stdout
140+
grep -i "ubuntu" /etc/*-release >/dev/null 2>&1
141+
if [ $? -eq 0 ];then
142+
grep -q "SYS_open" $stdout
143+
else
144+
grep -q "open@SYS" $stdout
145+
fi
141146
tc_pass_or_fail $? "ltrace -L -S command failed"
142147
}
143148

linux-tools/mlocate/locate.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,25 @@ function tc_local_setup()
5656
touch $locate_this
5757

5858
# temporarily stop cron process
59-
tc_service_stop_and_wait crond
59+
grep -i "ubuntu" /etc/*-release >/dev/null 2>&1
60+
rc=$?
61+
if [ $rc -eq 0 ];then
62+
tc_service_stop_and_wait cron
63+
else
64+
tc_service_stop_and_wait crond
65+
fi
6066
cron_stopped="yes"
6167
return 0
6268
}
6369

6470
function tc_local_cleanup()
6571
{
66-
[ "$cron_stopped" = "yes" ] && tc_service_start_and_wait crond
72+
if [ $rc -eq 0 ];then
73+
[ "$cron_stopped" = "yes" ] && tc_service_start_and_wait cron
74+
else
75+
[ "$cron_stopped" = "yes" ] && tc_service_start_and_wait crond
76+
fi
77+
6778
}
6879

6980
#

0 commit comments

Comments
 (0)