* [LTP] [PATCH] cpuhotplug05.sh: Make test to support some old version of 'sar'
[not found] ` <555A8744.5050300@cn.fujitsu.com>
@ 2015-07-02 9:26 ` Zeng Linggang
2015-07-02 11:42 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Zeng Linggang @ 2015-07-02 9:26 UTC (permalink / raw)
To: ltp-list; +Cc: naresh.kamboju, milosz.wasilewski
In commit 841c0eebc50068d6595b97b50ae0ee8e8f57c8ca:
We changed "sar 1 0" to "sar 1", but it make the test not
work well before 'sysstat-8.1.4(include sar)'.
Signed-off-by: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
---
.../kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
index 4491d3a..8a0f13b 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
@@ -81,11 +81,17 @@ TST_CLEANUP=do_clean
until [ $LOOP_COUNT -gt $HOTPLUG05_LOOPS ]; do
# Start up SAR and give it a couple cycles to run
- sar 1 &>/dev/null &
+ sar 1 0 &>/dev/null &
+ if [ $? -ne 0 ]; then
+ sar 1 &>/dev/null &
+ fi
sleep 2
if ps -C sar &>/dev/null; then
pkill sar
- sar -P ALL 1 > $TMP/log_$$ &
+ sar -P ALL 1 0 > $TMP/log_$$ &
+ if [ $? -ne 0 ]; then
+ sar -P ALL 1 > $TMP/log_$$ &
+ fi
else
sar -P ALL 1 > $TMP/log_$$ &
fi
--
1.9.3
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] cpuhotplug05.sh: Make test to support some old version of 'sar'
2015-07-02 9:26 ` [LTP] [PATCH] cpuhotplug05.sh: Make test to support some old version of 'sar' Zeng Linggang
@ 2015-07-02 11:42 ` Cyril Hrubis
2015-07-02 12:25 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2015-07-02 11:42 UTC (permalink / raw)
To: Zeng Linggang; +Cc: ltp-list, naresh.kamboju, milosz.wasilewski
Hi!
> In commit 841c0eebc50068d6595b97b50ae0ee8e8f57c8ca:
> We changed "sar 1 0" to "sar 1", but it make the test not
> work well before 'sysstat-8.1.4(include sar)'.
The old syntax does not work with newer sar. So the correct fix here is
to do runtime check and change parameters accordingly.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH] cpuhotplug05.sh: Make test to support some old version of 'sar'
2015-07-02 11:42 ` Cyril Hrubis
@ 2015-07-02 12:25 ` Cyril Hrubis
0 siblings, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2015-07-02 12:25 UTC (permalink / raw)
To: Zeng Linggang; +Cc: ltp-list, naresh.kamboju, milosz.wasilewski
Hi!
> > In commit 841c0eebc50068d6595b97b50ae0ee8e8f57c8ca:
> > We changed "sar 1 0" to "sar 1", but it make the test not
> > work well before 'sysstat-8.1.4(include sar)'.
>
> The old syntax does not work with newer sar. So the correct fix here is
> to do runtime check and change parameters accordingly.
Ah, sorry for replying before I finished my coffee...
The code does exactly that but I would be happier if we had the fi only
in one place, something like:
sar 1 0 > /dev/null &
pid=$!
if kill -0 $pid 2> /dev/null; then
kill $pid
SAR_PARAMS="1 0"
else
SAR_PARAMS="1"
fi
...
sar $SAR_PARAMS ...
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-02 12:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1431958682-15683-1-git-send-email-chase.qi@linaro.org>
[not found] ` <555A8744.5050300@cn.fujitsu.com>
2015-07-02 9:26 ` [LTP] [PATCH] cpuhotplug05.sh: Make test to support some old version of 'sar' Zeng Linggang
2015-07-02 11:42 ` Cyril Hrubis
2015-07-02 12:25 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox