* [LTP] [PATCH 1/3] ltp/tools: remove the scripts/numa_test.sh file @ 2015-08-18 8:36 Li Wang 2015-08-18 8:36 ` [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty Li Wang 2015-08-20 15:44 ` [LTP] [PATCH 1/3] ltp/tools: remove the scripts/numa_test.sh file Cyril Hrubis 0 siblings, 2 replies; 6+ messages in thread From: Li Wang @ 2015-08-18 8:36 UTC (permalink / raw) To: ltp-list Not only ltp/Makefile cancel the calling of the numa_test.sh, but there are no any other testcases using it. per: ef77253961f909f87e82e6d2b620e87af33e9665 ltp also has another copy of it: /testcases/kernel/numa/test.sh Signed-off-by: Li Wang <liwang@redhat.com> --- tools/scripts/numa_test.sh | 53 ---------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100755 tools/scripts/numa_test.sh diff --git a/tools/scripts/numa_test.sh b/tools/scripts/numa_test.sh deleted file mode 100755 index 1b46149..0000000 --- a/tools/scripts/numa_test.sh +++ /dev/null @@ -1,53 +0,0 @@ -############################################################################# -## -## Copyright (c) International Business Machines Corp., 2007 -## -## This program is free software; you can redistribute it and#or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -## for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -############################################################################# -# -# Author Pradeep Kumar Surisetty, pradeepkumars@in.ibm.com -# -# History Nov 27 2007 -created- pradeep kumar surisetty -#! /bin/sh -# -# File : numa_test.sh - - -#!/bin/sh -x=0 -chk_ifexist() -{ -if [ ! -d /sys/devices/system/node ] -then -x=0 -else -x=$(ls /sys/devices/system/node | wc -l) -fi -if [ $x -gt 1 ] -then - if [ ! -f /usr/include/numa.h ] - then - echo no; - else - echo yes; - fi -else - echo no; #numa is not present - -fi -} -chk_ifexist - -- 1.8.3.1 ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty 2015-08-18 8:36 [LTP] [PATCH 1/3] ltp/tools: remove the scripts/numa_test.sh file Li Wang @ 2015-08-18 8:36 ` Li Wang 2015-08-18 8:36 ` [LTP] [PATCH 3/3] pounder/cpufreq: Skip the test if processors are not supported by cpufreq Li Wang 2015-08-20 15:52 ` [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty Cyril Hrubis 2015-08-20 15:44 ` [LTP] [PATCH 1/3] ltp/tools: remove the scripts/numa_test.sh file Cyril Hrubis 1 sibling, 2 replies; 6+ messages in thread From: Li Wang @ 2015-08-18 8:36 UTC (permalink / raw) To: ltp-list During the pounder21 test, it gives many errors like: ./pounder: line 262: /dev/tty: No such device or address ./pounder: line 263: /dev/tty: No such device or address After google '/dev/tty', got this description: /dev/tty is the controlling terminal for the current process, if there is such a terminal. Do ps -a and look for /dev/tty. If it doesn't appear then that process doesn't have a controlling terminal. It is quite normal for there to be no controlling terminal. So if there is no device associated with it then the kernel will just ignore anything you send to that file. It only cares if it has attached a device (possibly pseudo) to that node. If it does care, and echoing is on, then anything you send to the (special) file will be echoed. The second part may be related to the login shell. Check in /etc/passwd and make sure that you really do start bash for the user you are logging in as. Using /bin/sh instead is a likely cause. So do grep username /etc/passwd and look for the path to the program that is launched at the end of the text line. If its /bin/sh then you have the wrong shell. What you should have is /bin/bash. Signed-off-by: Li Wang <liwang@redhat.com> --- tools/pounder21/Install | 2 +- tools/pounder21/fancy_timed_loop.c | 2 +- tools/pounder21/infinite_loop.c | 2 +- tools/pounder21/pounder | 14 +++++++------- tools/pounder21/test_scripts/memtest | 2 +- tools/pounder21/timed_loop.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tools/pounder21/Install b/tools/pounder21/Install index bf13528..6fb3a8f 100755 --- a/tools/pounder21/Install +++ b/tools/pounder21/Install @@ -65,7 +65,7 @@ done # Set up optdir mkdir -p "$POUNDER_OPTDIR" if [ ! -d "$POUNDER_OPTDIR" ]; then - echo "Could not create $POUNDER_OPTDIR; aborting." > /dev/tty + echo "Could not create $POUNDER_OPTDIR; aborting." exit 1 fi diff --git a/tools/pounder21/fancy_timed_loop.c b/tools/pounder21/fancy_timed_loop.c index cf8580e..50305c3 100644 --- a/tools/pounder21/fancy_timed_loop.c +++ b/tools/pounder21/fancy_timed_loop.c @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) tty_fp = fdopen(3, "w+"); if (tty_fp == NULL) { - tty_fp = fopen("/dev/tty", "w+"); + tty_fp = fdopen(STDOUT_FILENO, "w+"); if (tty_fp == NULL) { perror("stdout"); exit(2); diff --git a/tools/pounder21/infinite_loop.c b/tools/pounder21/infinite_loop.c index d78b442..804dd2e 100644 --- a/tools/pounder21/infinite_loop.c +++ b/tools/pounder21/infinite_loop.c @@ -77,7 +77,7 @@ int main(int argc, char *argv[]) tty_fp = fdopen(3, "w+"); if (tty_fp == NULL) { - tty_fp = fopen("/dev/tty", "w+"); + tty_fp = fdopen(STDOUT_FILENO, "w+"); if (tty_fp == NULL) { perror("stdout"); exit(2); diff --git a/tools/pounder21/pounder b/tools/pounder21/pounder index c3defcf..caf60d3 100755 --- a/tools/pounder21/pounder +++ b/tools/pounder21/pounder @@ -201,8 +201,8 @@ shift `expr $OPTIND - 1` # Are we already running? if [ -f "$POUNDER_PIDFILE" ]; then - echo "File $POUNDER_PIDFILE exists; pounder may already be running." > /dev/tty - echo "Either run 'pounder -k' to stop all tests, or remove it." > /dev/tty + echo "File $POUNDER_PIDFILE exists; pounder may already be running." + echo "Either run 'pounder -k' to stop all tests, or remove it." exit 1 fi @@ -225,21 +225,21 @@ fi # Set up log directory mkdir -p "$POUNDER_LOGDIR" 2> /dev/null if [ ! -d "$POUNDER_LOGDIR" ]; then - echo "Could not create $POUNDER_LOGDIR; aborting." > /dev/tty + echo "Could not create $POUNDER_LOGDIR; aborting." exit 1 fi # Set up dir for optional components mkdir -p "$POUNDER_OPTDIR" if [ ! -d "$POUNDER_OPTDIR" ]; then - echo "Could not create $POUNDER_OPTDIR; aborting." > /dev/tty + echo "Could not create $POUNDER_OPTDIR; aborting." exit 1 fi # Set up tmpdir mkdir -p "$POUNDER_TMPDIR" if [ ! -d "$POUNDER_TMPDIR" ]; then - echo "Could not create $POUNDER_TMPDIR; aborting." > /dev/tty + echo "Could not create $POUNDER_TMPDIR; aborting." exit 1 fi @@ -259,8 +259,8 @@ fi export > "$POUNDER_LOGDIR/environment" echo "Starting $POUNDER_VERSION" -echo "STARTING TESTS." > /dev/tty -echo "To kill all tests, run 'pounder -k' or press ^C."> /dev/tty +echo "STARTING TESTS." +echo "To kill all tests, run 'pounder -k' or press ^C." # Handle the duration thing... function kill_after { diff --git a/tools/pounder21/test_scripts/memtest b/tools/pounder21/test_scripts/memtest index c040147..e212bde 100755 --- a/tools/pounder21/test_scripts/memtest +++ b/tools/pounder21/test_scripts/memtest @@ -22,7 +22,7 @@ # Can we find the script? if [ ! -f "$POUNDER_OPTDIR/memtest.sh" ]; then - echo "Can't find memtest.sh; did you run Install?" > /dev/tty + echo "Can't find memtest.sh; did you run Install?" exit -1 fi diff --git a/tools/pounder21/timed_loop.c b/tools/pounder21/timed_loop.c index 966c08a..0cd7305 100644 --- a/tools/pounder21/timed_loop.c +++ b/tools/pounder21/timed_loop.c @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) tty_fp = fdopen(3, "w+"); if (tty_fp == NULL) { - tty_fp = fopen("/dev/tty", "w+"); + tty_fp = fdopen(STDOUT_FILENO, "w+"); if (tty_fp == NULL) { perror("stdout"); exit(2); -- 1.8.3.1 ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH 3/3] pounder/cpufreq: Skip the test if processors are not supported by cpufreq 2015-08-18 8:36 ` [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty Li Wang @ 2015-08-18 8:36 ` Li Wang 2015-08-20 15:58 ` Cyril Hrubis 2015-08-20 15:52 ` [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty Cyril Hrubis 1 sibling, 1 reply; 6+ messages in thread From: Li Wang @ 2015-08-18 8:36 UTC (permalink / raw) To: ltp-list During the pounder21/cpufreq test, it print so many errors: [2015-08-17 08:43:24] (17818) cpufreq.bin: FAIL with code 4. [2015-08-17 08:43:24] (17818) cpufreq.bin: START loop #2. [2015-08-17 08:43:25] (17812) cpufreq.bin: FAIL with code 4. [2015-08-17 08:43:25] (17812) cpufreq.bin: START loop #2. [2015-08-17 08:43:27] (17812) cpufreq.bin: FAIL with code 4. ... The reason is that the case canceled some cpufreq check steps before, now reuse them to make sure it could be skiped on a system without cpufreq support. Signed-off-by: Li Wang <liwang@redhat.com> --- tools/pounder21/test_scripts/cpufreq | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/pounder21/test_scripts/cpufreq b/tools/pounder21/test_scripts/cpufreq index ba94a76..4df70a9 100755 --- a/tools/pounder21/test_scripts/cpufreq +++ b/tools/pounder21/test_scripts/cpufreq @@ -21,12 +21,12 @@ # Do any CPU support cpufreq? -#CPUFREQ_ENABLED_CPUS=`/bin/ls -lad /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null | wc -l` +CPUFREQ_ENABLED_CPUS=`/bin/ls -lad /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null | wc -l` -#if [ "$CPUFREQ_ENABLED_CPUS" -lt 1 ]; then -# echo "None of your CPUs support cpufreq. Bye." -# exit 255 -#fi +if [ "$CPUFREQ_ENABLED_CPUS" -lt 1 ]; then + echo "None of your CPUs support cpufreq. Bye." + exit 255 +fi # Turn on acpi_pstate_strict to ensure that state transitions actually happen... if [ -f /sys/module/acpi_cpufreq/parameters/acpi_pstate_strict ]; then -- 1.8.3.1 ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 3/3] pounder/cpufreq: Skip the test if processors are not supported by cpufreq 2015-08-18 8:36 ` [LTP] [PATCH 3/3] pounder/cpufreq: Skip the test if processors are not supported by cpufreq Li Wang @ 2015-08-20 15:58 ` Cyril Hrubis 0 siblings, 0 replies; 6+ messages in thread From: Cyril Hrubis @ 2015-08-20 15:58 UTC (permalink / raw) To: Li Wang; +Cc: ltp-list Hi! > # Do any CPU support cpufreq? > -#CPUFREQ_ENABLED_CPUS=`/bin/ls -lad /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null | wc -l` > +CPUFREQ_ENABLED_CPUS=`/bin/ls -lad /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null | wc -l` Calling ls by full path is simply wrong. > -#if [ "$CPUFREQ_ENABLED_CPUS" -lt 1 ]; then > -# echo "None of your CPUs support cpufreq. Bye." > -# exit 255 > -#fi > +if [ "$CPUFREQ_ENABLED_CPUS" -lt 1 ]; then > + echo "None of your CPUs support cpufreq. Bye." > + exit 255 > +fi This part of code was specially disabled in one commit, unfortunately it does not say why exactly it was disabled. So I'm hesitant to enable it unless we are sure that the code actually works fine on several distributions. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty 2015-08-18 8:36 ` [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty Li Wang 2015-08-18 8:36 ` [LTP] [PATCH 3/3] pounder/cpufreq: Skip the test if processors are not supported by cpufreq Li Wang @ 2015-08-20 15:52 ` Cyril Hrubis 1 sibling, 0 replies; 6+ messages in thread From: Cyril Hrubis @ 2015-08-20 15:52 UTC (permalink / raw) To: Li Wang; +Cc: ltp-list Hi! > During the pounder21 test, it gives many errors like: > > ./pounder: line 262: /dev/tty: No such device or address > ./pounder: line 263: /dev/tty: No such device or address > > After google '/dev/tty', got this description: > > /dev/tty is the controlling terminal for the current process, if there is such a terminal. > Do ps -a and look for /dev/tty. If it doesn't appear then that process doesn't have a > controlling terminal. It is quite normal for there to be no controlling terminal. So if > there is no device associated with it then the kernel will just ignore anything you send > to that file. It only cares if it has attached a device (possibly pseudo) to that node. If > it does care, and echoing is on, then anything you send to the (special) file will be echoed. Writing directly to /dev/tty is indeed wrong thing to do. > The second part may be related to the login shell. Check in /etc/passwd and make sure that > you really do start bash for the user you are logging in as. Using /bin/sh instead is a likely cause. > So do grep username /etc/passwd and look for the path to the program that is launched at the end of > the text line. If its /bin/sh then you have the wrong shell. What you should have is /bin/bash. Eh? I do not understand this part at all. It does not seem to be related to the problem at all. > Signed-off-by: Li Wang <liwang@redhat.com> > --- > tools/pounder21/Install | 2 +- > tools/pounder21/fancy_timed_loop.c | 2 +- > tools/pounder21/infinite_loop.c | 2 +- > tools/pounder21/pounder | 14 +++++++------- > tools/pounder21/test_scripts/memtest | 2 +- > tools/pounder21/timed_loop.c | 2 +- > 6 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/tools/pounder21/Install b/tools/pounder21/Install > index bf13528..6fb3a8f 100755 > --- a/tools/pounder21/Install > +++ b/tools/pounder21/Install > @@ -65,7 +65,7 @@ done > # Set up optdir > mkdir -p "$POUNDER_OPTDIR" > if [ ! -d "$POUNDER_OPTDIR" ]; then > - echo "Could not create $POUNDER_OPTDIR; aborting." > /dev/tty > + echo "Could not create $POUNDER_OPTDIR; aborting." > exit 1 > fi > > diff --git a/tools/pounder21/fancy_timed_loop.c b/tools/pounder21/fancy_timed_loop.c > index cf8580e..50305c3 100644 > --- a/tools/pounder21/fancy_timed_loop.c > +++ b/tools/pounder21/fancy_timed_loop.c > @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) > > tty_fp = fdopen(3, "w+"); > if (tty_fp == NULL) { > - tty_fp = fopen("/dev/tty", "w+"); > + tty_fp = fdopen(STDOUT_FILENO, "w+"); > if (tty_fp == NULL) { > perror("stdout"); > exit(2); Can't we rather rename the FILE * to 'out' or similar, naming it tty_fp when it does not point to tty is kind of confusing. Also we can simply do FILE *out = stdout; If we reopen it by it's file descriptior we will end up with two different file objects, each of them will buffer data and we will end up with messed output when something will write to stdout and not the one we created. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 1/3] ltp/tools: remove the scripts/numa_test.sh file 2015-08-18 8:36 [LTP] [PATCH 1/3] ltp/tools: remove the scripts/numa_test.sh file Li Wang 2015-08-18 8:36 ` [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty Li Wang @ 2015-08-20 15:44 ` Cyril Hrubis 1 sibling, 0 replies; 6+ messages in thread From: Cyril Hrubis @ 2015-08-20 15:44 UTC (permalink / raw) To: Li Wang; +Cc: ltp-list Hi! Pushed, thanks. -- Cyril Hrubis chrubis@suse.cz ------------------------------------------------------------------------------ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-20 15:59 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-08-18 8:36 [LTP] [PATCH 1/3] ltp/tools: remove the scripts/numa_test.sh file Li Wang 2015-08-18 8:36 ` [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty Li Wang 2015-08-18 8:36 ` [LTP] [PATCH 3/3] pounder/cpufreq: Skip the test if processors are not supported by cpufreq Li Wang 2015-08-20 15:58 ` Cyril Hrubis 2015-08-20 15:52 ` [LTP] [PATCH 2/3] ltp/pounder: Don't let the testing log output to /dev/tty Cyril Hrubis 2015-08-20 15:44 ` [LTP] [PATCH 1/3] ltp/tools: remove the scripts/numa_test.sh file Cyril Hrubis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox