All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] [PATCH] Add test cases of service nscd.
@ 2019-02-12  7:15 Wang Mingyu
  2019-02-12  7:15 ` [Fuego] [PATCH] Modify the function exec_service_on_target to get status of service Wang Mingyu
  2019-02-16  2:04 ` [Fuego] [PATCH] Add test cases of service nscd Tim.Bird
  0 siblings, 2 replies; 4+ messages in thread
From: Wang Mingyu @ 2019-02-12  7:15 UTC (permalink / raw)
  To: fuego

The nscd is a daemon that provides a cache for the most common name service requests.
This test set is used to check if the ps, pidfile and syslog of the service can be generated successfully.

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 tests/Functional.nscd/fuego_test.sh         | 18 +++++++++
 tests/Functional.nscd/nscd_test.sh          |  4 ++
 tests/Functional.nscd/parser.py             | 22 +++++++++++
 tests/Functional.nscd/spec.json             |  7 ++++
 tests/Functional.nscd/tests/nscd_pidfile.sh | 57 +++++++++++++++++++++++++++++
 tests/Functional.nscd/tests/nscd_ps.sh      | 51 ++++++++++++++++++++++++++
 tests/Functional.nscd/tests/nscd_syslog.sh  | 55 ++++++++++++++++++++++++++++
 7 files changed, 214 insertions(+)
 create mode 100644 tests/Functional.nscd/fuego_test.sh
 create mode 100755 tests/Functional.nscd/nscd_test.sh
 create mode 100644 tests/Functional.nscd/parser.py
 create mode 100644 tests/Functional.nscd/spec.json
 create mode 100644 tests/Functional.nscd/tests/nscd_pidfile.sh
 create mode 100644 tests/Functional.nscd/tests/nscd_ps.sh
 create mode 100644 tests/Functional.nscd/tests/nscd_syslog.sh

diff --git a/tests/Functional.nscd/fuego_test.sh b/tests/Functional.nscd/fuego_test.sh
new file mode 100644
index 0000000..f27e1d0
--- /dev/null
+++ b/tests/Functional.nscd/fuego_test.sh
@@ -0,0 +1,18 @@
+function test_pre_check {
+    assert_has_program nscd
+}
+
+function test_deploy {
+    put $TEST_HOME/nscd_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
+    put $FUEGO_CORE/engine/scripts/fuego_board_function_lib.sh $BOARD_TESTDIR/fuego.$TESTDIR
+    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
+}
+
+function test_run {
+    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
+    ./nscd_test.sh"
+}
+
+function test_processing {
+    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
+}
diff --git a/tests/Functional.nscd/nscd_test.sh b/tests/Functional.nscd/nscd_test.sh
new file mode 100755
index 0000000..dd5ce37
--- /dev/null
+++ b/tests/Functional.nscd/nscd_test.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+for i in tests/*.sh; do
+    sh $i
+done
diff --git a/tests/Functional.nscd/parser.py b/tests/Functional.nscd/parser.py
new file mode 100644
index 0000000..d85abd7
--- /dev/null
+++ b/tests/Functional.nscd/parser.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# See common.py for description of command-line arguments
+
+import os, sys, collections
+
+sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
+import common as plib
+
+measurements = {}
+measurements = collections.OrderedDict()
+
+regex_string = '^ -> (.*): TEST-(.*)$'
+matches = plib.parse_log(regex_string)
+
+if matches:
+    for m in matches:
+        measurements['default.' + m[0]] = 'PASS' if m[1] == 'PASS' else 'FAIL'
+
+# split the output for each testcase
+plib.split_output_per_testcase(regex_string, measurements)
+
+sys.exit(plib.process(measurements))
diff --git a/tests/Functional.nscd/spec.json b/tests/Functional.nscd/spec.json
new file mode 100644
index 0000000..f573a33
--- /dev/null
+++ b/tests/Functional.nscd/spec.json
@@ -0,0 +1,7 @@
+{
+    "testName": "Functional.nscd",
+    "specs": {
+        "default": {}
+    }
+}
+
diff --git a/tests/Functional.nscd/tests/nscd_pidfile.sh b/tests/Functional.nscd/tests/nscd_pidfile.sh
new file mode 100644
index 0000000..6082475
--- /dev/null
+++ b/tests/Functional.nscd/tests/nscd_pidfile.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+#  In the target start nscd, and check if the /var/run/nscd.pid is exist
+#  check the keyword "nscd".
+
+test="pidfile"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+nscd_status=$(exec_service_on_target nscd status)
+
+exec_service_on_target nscd stop
+
+if [ -f /run/nscd/nscd.pid ]
+then
+    rm -f /run/nscd/nscd.pid
+fi
+
+if exec_service_on_target nscd start
+then
+    echo " -> start of nscd succeeded."
+else
+    echo " -> start of nscd failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 10
+
+if test -f /run/nscd/nscd.pid
+then
+    echo " -> get the pidfile of nscd."
+else
+    echo " -> can't get the pidfile of nscd."
+    echo " -> $test: TEST-FAIL"
+    if [ "$nscd_status" != "active" ]
+    then
+        exec_service_on_target nscd stop
+    fi
+    exit
+fi
+
+exec_service_on_target nscd stop
+
+if test ! -f /run/nscd/nscd.pid
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+
+if [ "$nscd_status" = "active" ]
+then
+    exec_service_on_target nscd start
+fi
diff --git a/tests/Functional.nscd/tests/nscd_ps.sh b/tests/Functional.nscd/tests/nscd_ps.sh
new file mode 100644
index 0000000..9b90e39
--- /dev/null
+++ b/tests/Functional.nscd/tests/nscd_ps.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+#  In the target start nscd, and confirm the process condition by command ps.
+
+test="ps"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+
+nscd_status=$(exec_service_on_target nscd status)
+
+exec_service_on_target nscd stop
+
+if exec_service_on_target nscd start
+then
+    echo " -> start of nscd succeeded."
+else
+    echo " -> start of nscd failed."
+    echo " -> $test: TEST-FAIL"
+    exit
+fi
+
+sleep 5
+
+if ps aux | grep "[/]usr/sbin/nscd"
+then
+    echo " -> get the process of nscd."
+else
+    echo " -> can't get the process of nscd."
+    echo " -> $test: TEST-FAIL"
+    if [ "$nscd_status" != "active" ]
+    then
+        exec_service_on_target nscd stop
+    fi
+    exit
+fi
+
+exec_service_on_target nscd stop
+
+if ps aux | grep "[/]usr/sbin/nscd"
+then
+    echo " -> $test: TEST-FAIL"
+else
+    echo " -> $test: TEST-PASS"
+fi
+
+if [ "$nscd_status" = "active" ]
+then
+    exec_service_on_target nscd start
+fi
diff --git a/tests/Functional.nscd/tests/nscd_syslog.sh b/tests/Functional.nscd/tests/nscd_syslog.sh
new file mode 100644
index 0000000..09d2e72
--- /dev/null
+++ b/tests/Functional.nscd/tests/nscd_syslog.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+#  In the target start nscd, and check the messages of /var/log/syslog.
+#  check the keyword "nscd".
+
+test="syslog"
+
+. ./fuego_board_function_lib.sh
+
+set_init_manager
+logger_service=$(detect_logger_service)
+
+nscd_status=$(exec_service_on_target nscd status)
+
+exec_service_on_target nscd stop
+exec_service_on_target $logger_service stop
+
+if [ -f /var/log/syslog ]
+then
+    mv /var/log/syslog /var/log/syslog_bak
+fi
+
+restore_target(){
+    if [ -f /var/log/syslog_bak ]
+    then
+        mv /var/log/syslog_bak /var/log/syslog
+    fi
+}
+
+exec_service_on_target $logger_service restart
+
+if exec_service_on_target nscd start
+then
+    echo " -> start of nscd succeeded."
+else
+    echo " -> start of nscd failed."
+    echo " -> $test: TEST-FAIL"
+    restore_target
+    exit
+fi
+
+sleep 10
+
+if cat /var/log/syslog | grep "starting up"
+then
+    echo " -> $test: TEST-PASS"
+else
+    echo " -> $test: TEST-FAIL"
+fi
+
+if [ "$nscd_status" != "active" ]
+then
+    exec_service_on_target nscd stop
+fi
+restore_target
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Fuego] [PATCH] Modify the function exec_service_on_target to get status of service.
  2019-02-12  7:15 [Fuego] [PATCH] Add test cases of service nscd Wang Mingyu
@ 2019-02-12  7:15 ` Wang Mingyu
  2019-02-16  1:30   ` Tim.Bird
  2019-02-16  2:04 ` [Fuego] [PATCH] Add test cases of service nscd Tim.Bird
  1 sibling, 1 reply; 4+ messages in thread
From: Wang Mingyu @ 2019-02-12  7:15 UTC (permalink / raw)
  To: fuego

Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
---
 scripts/fuego_board_function_lib.sh | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/scripts/fuego_board_function_lib.sh b/scripts/fuego_board_function_lib.sh
index 4c29bf3..eb9d877 100644
--- a/scripts/fuego_board_function_lib.sh
+++ b/scripts/fuego_board_function_lib.sh
@@ -11,6 +11,7 @@
 
 init_manager="init_manager-not-set"
 logger_service="logger_service-not-set"
+service_status="service-not-running"
 
 # set_init_manager:
 #   detects and sets the init_manager variable, which indicates which
@@ -40,11 +41,27 @@ detect_logger_service() {
 # $1: service name
 # $2: action to perform (e.g. start, stop, restart)
 # relies on $init_manager being set prior to call
+# returns: status of service
 exec_service_on_target() {
     if [ "$init_manager" = "systemd" ]
     then
-        systemctl $2 $1
+        if [ "$2" = "status" ]
+        then
+            service_status=$(systemctl is-active $1)
+        else
+            systemctl $2 $1
+        fi
     else
-        /etc/init.d/$1 $2
+        if [ "$2" = "status" ]
+        then
+            if /etc/init.d/$1 status | grep "is running"
+            then
+                service_status="active"
+            fi
+        else
+#           service $1 $2
+            /etc/init.d/$1 $2
+        fi
     fi
+    echo $service_status
 }
-- 
1.8.3.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Fuego] [PATCH] Modify the function exec_service_on_target to get status of service.
  2019-02-12  7:15 ` [Fuego] [PATCH] Modify the function exec_service_on_target to get status of service Wang Mingyu
@ 2019-02-16  1:30   ` Tim.Bird
  0 siblings, 0 replies; 4+ messages in thread
From: Tim.Bird @ 2019-02-16  1:30 UTC (permalink / raw)
  To: wangmy, fuego

Thank you for this update.  Please see comments inline below.

> -----Original Message-----
> From: Wang Mingyu
> 
This patch needs a message for the body of the commit, explaining
what the patch does.

> Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
> ---
>  scripts/fuego_board_function_lib.sh | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/fuego_board_function_lib.sh
> b/scripts/fuego_board_function_lib.sh
> index 4c29bf3..eb9d877 100644
> --- a/scripts/fuego_board_function_lib.sh
> +++ b/scripts/fuego_board_function_lib.sh
> @@ -11,6 +11,7 @@
> 
>  init_manager="init_manager-not-set"
>  logger_service="logger_service-not-set"
> +service_status="service-not-running"
This should be "unknown" or something like that.
It is not correct to assume the service is not running, if, for example,
the service rc script doesn't support the 'status' operation.

More comments on this below.

> 
>  # set_init_manager:
>  #   detects and sets the init_manager variable, which indicates which
> @@ -40,11 +41,27 @@ detect_logger_service() {
>  # $1: service name
>  # $2: action to perform (e.g. start, stop, restart)
>  # relies on $init_manager being set prior to call
> +# returns: status of service
>  exec_service_on_target() {
>      if [ "$init_manager" = "systemd" ]
>      then
> -        systemctl $2 $1
> +        if [ "$2" = "status" ]
> +        then
> +            service_status=$(systemctl is-active $1)
> +        else
> +            systemctl $2 $1
> +        fi
This is a nice improvement.  Thanks.

>      else
> -        /etc/init.d/$1 $2
> +        if [ "$2" = "status" ]
> +        then
> +            if /etc/init.d/$1 status | grep "is running"
> +            then
> +                service_status="active"
> +            fi
> +        else
> +#           service $1 $2
What is the purpose of this comment?

> +            /etc/init.d/$1 $2
> +        fi
>      fi
> +    echo $service_status
Is this right?  Is it correct to echo the service status if the action was start or stop?

>  }
> --
> 1.8.3.1

Two things here:
1) there's no code that uses 'service'.  This seems like it was the successor
to directly calling the rc script, and the predecessor to systemctl.  I don't know
if there are very many systems out there that use service, but don't allow
directly calling the rc script (that aren't also system-based).  That is to say,
it's hard to know if making a third option for the init_manager is worthwhile
or not.  But that's independent, I think, of the current patch.

2) we should use 'unknown' when the status is unknown.
In general, I think that if the rc script does not support the 'status' operation,
then we should return 'unknown' for the status, and then let the script
decide whether to abort or continue, based on that status.

Please let me know what you think.
 -- Tim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Fuego] [PATCH] Add test cases of service nscd.
  2019-02-12  7:15 [Fuego] [PATCH] Add test cases of service nscd Wang Mingyu
  2019-02-12  7:15 ` [Fuego] [PATCH] Modify the function exec_service_on_target to get status of service Wang Mingyu
@ 2019-02-16  2:04 ` Tim.Bird
  1 sibling, 0 replies; 4+ messages in thread
From: Tim.Bird @ 2019-02-16  2:04 UTC (permalink / raw)
  To: wangmy, fuego

Applied to fuegotest/fuego-core next branch.

Thanks.  There are some comments inline below.
 -- Tim


> -----Original Message-----
> From: Wang Mingyu
> 
> The nscd is a daemon that provides a cache for the most common name
> service requests.
> This test set is used to check if the ps, pidfile and syslog of the service can be
> generated successfully.

I word-wrapped this a bit better.

> 
> Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
> ---
>  tests/Functional.nscd/fuego_test.sh         | 18 +++++++++
>  tests/Functional.nscd/nscd_test.sh          |  4 ++
>  tests/Functional.nscd/parser.py             | 22 +++++++++++
>  tests/Functional.nscd/spec.json             |  7 ++++
>  tests/Functional.nscd/tests/nscd_pidfile.sh | 57
> +++++++++++++++++++++++++++++
>  tests/Functional.nscd/tests/nscd_ps.sh      | 51
> ++++++++++++++++++++++++++
>  tests/Functional.nscd/tests/nscd_syslog.sh  | 55
> ++++++++++++++++++++++++++++
>  7 files changed, 214 insertions(+)
>  create mode 100644 tests/Functional.nscd/fuego_test.sh
>  create mode 100755 tests/Functional.nscd/nscd_test.sh
>  create mode 100644 tests/Functional.nscd/parser.py
>  create mode 100644 tests/Functional.nscd/spec.json
>  create mode 100644 tests/Functional.nscd/tests/nscd_pidfile.sh
>  create mode 100644 tests/Functional.nscd/tests/nscd_ps.sh
>  create mode 100644 tests/Functional.nscd/tests/nscd_syslog.sh
> 
> diff --git a/tests/Functional.nscd/fuego_test.sh
> b/tests/Functional.nscd/fuego_test.sh
> new file mode 100644
> index 0000000..f27e1d0
> --- /dev/null
> +++ b/tests/Functional.nscd/fuego_test.sh
> @@ -0,0 +1,18 @@
> +function test_pre_check {
> +    assert_has_program nscd
> +}
> +
> +function test_deploy {
> +    put $TEST_HOME/nscd_test.sh $BOARD_TESTDIR/fuego.$TESTDIR/
> +    put $FUEGO_CORE/engine/scripts/fuego_board_function_lib.sh
> $BOARD_TESTDIR/fuego.$TESTDIR
> +    put -r $TEST_HOME/tests $BOARD_TESTDIR/fuego.$TESTDIR/
> +}
> +
> +function test_run {
> +    report "cd $BOARD_TESTDIR/fuego.$TESTDIR;\
> +    ./nscd_test.sh"
> +}
> +
> +function test_processing {
> +    log_compare "$TESTDIR" "0" "TEST-FAIL" "n"
> +}
> diff --git a/tests/Functional.nscd/nscd_test.sh
> b/tests/Functional.nscd/nscd_test.sh
> new file mode 100755
> index 0000000..dd5ce37
> --- /dev/null
> +++ b/tests/Functional.nscd/nscd_test.sh
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +for i in tests/*.sh; do
> +    sh $i
> +done
> diff --git a/tests/Functional.nscd/parser.py
> b/tests/Functional.nscd/parser.py
> new file mode 100644
> index 0000000..d85abd7
> --- /dev/null
> +++ b/tests/Functional.nscd/parser.py
> @@ -0,0 +1,22 @@
> +#!/usr/bin/python
> +# See common.py for description of command-line arguments
> +
> +import os, sys, collections
> +
> +sys.path.insert(0, os.environ['FUEGO_CORE'] + '/engine/scripts/parser')
> +import common as plib
> +
> +measurements = {}
> +measurements = collections.OrderedDict()
> +
> +regex_string = '^ -> (.*): TEST-(.*)$'
> +matches = plib.parse_log(regex_string)
> +
> +if matches:
> +    for m in matches:
> +        measurements['default.' + m[0]] = 'PASS' if m[1] == 'PASS' else 'FAIL'
> +
> +# split the output for each testcase
> +plib.split_output_per_testcase(regex_string, measurements)
> +
> +sys.exit(plib.process(measurements))
> diff --git a/tests/Functional.nscd/spec.json
> b/tests/Functional.nscd/spec.json
> new file mode 100644
> index 0000000..f573a33
> --- /dev/null
> +++ b/tests/Functional.nscd/spec.json
> @@ -0,0 +1,7 @@
> +{
> +    "testName": "Functional.nscd",
> +    "specs": {
> +        "default": {}
> +    }
> +}
> +
I removed this extra newline at the end of the spec.json file.

> diff --git a/tests/Functional.nscd/tests/nscd_pidfile.sh
> b/tests/Functional.nscd/tests/nscd_pidfile.sh
> new file mode 100644
> index 0000000..6082475
> --- /dev/null
> +++ b/tests/Functional.nscd/tests/nscd_pidfile.sh
> @@ -0,0 +1,57 @@
> +#!/bin/sh
> +
> +#  In the target start nscd, and check if the /var/run/nscd.pid is exist
> +#  check the keyword "nscd".
> +
> +test="pidfile"
> +
> +. ./fuego_board_function_lib.sh
> +
> +set_init_manager
> +
> +nscd_status=$(exec_service_on_target nscd status)
> +
> +exec_service_on_target nscd stop
> +
> +if [ -f /run/nscd/nscd.pid ]
> +then
> +    rm -f /run/nscd/nscd.pid
> +fi
> +
> +if exec_service_on_target nscd start
> +then
> +    echo " -> start of nscd succeeded."
> +else
> +    echo " -> start of nscd failed."
> +    echo " -> $test: TEST-FAIL"
> +    exit
> +fi
> +
> +sleep 10
> +
> +if test -f /run/nscd/nscd.pid
> +then
> +    echo " -> get the pidfile of nscd."
> +else
> +    echo " -> can't get the pidfile of nscd."
> +    echo " -> $test: TEST-FAIL"
> +    if [ "$nscd_status" != "active" ]
> +    then
> +        exec_service_on_target nscd stop
> +    fi
> +    exit
> +fi
> +
> +exec_service_on_target nscd stop
> +
> +if test ! -f /run/nscd/nscd.pid
> +then
> +    echo " -> $test: TEST-PASS"
> +else
> +    echo " -> $test: TEST-FAIL"
> +fi
> +
> +if [ "$nscd_status" = "active" ]
> +then
> +    exec_service_on_target nscd start
> +fi
> diff --git a/tests/Functional.nscd/tests/nscd_ps.sh
> b/tests/Functional.nscd/tests/nscd_ps.sh
> new file mode 100644
> index 0000000..9b90e39
> --- /dev/null
> +++ b/tests/Functional.nscd/tests/nscd_ps.sh
> @@ -0,0 +1,51 @@
> +#!/bin/sh
> +
> +#  In the target start nscd, and confirm the process condition by command
> ps.
> +
> +test="ps"
> +
> +. ./fuego_board_function_lib.sh
> +
> +set_init_manager
> +
> +nscd_status=$(exec_service_on_target nscd status)
> +
> +exec_service_on_target nscd stop
> +
> +if exec_service_on_target nscd start
> +then
> +    echo " -> start of nscd succeeded."
> +else
> +    echo " -> start of nscd failed."
> +    echo " -> $test: TEST-FAIL"
> +    exit
> +fi
> +
> +sleep 5
> +
> +if ps aux | grep "[/]usr/sbin/nscd"
> +then
> +    echo " -> get the process of nscd."
> +else
> +    echo " -> can't get the process of nscd."
> +    echo " -> $test: TEST-FAIL"
> +    if [ "$nscd_status" != "active" ]
> +    then
> +        exec_service_on_target nscd stop
> +    fi
> +    exit
> +fi
> +
> +exec_service_on_target nscd stop
> +
> +if ps aux | grep "[/]usr/sbin/nscd"
> +then
> +    echo " -> $test: TEST-FAIL"
> +else
> +    echo " -> $test: TEST-PASS"
> +fi
> +
> +if [ "$nscd_status" = "active" ]
> +then
> +    exec_service_on_target nscd start
> +fi
> diff --git a/tests/Functional.nscd/tests/nscd_syslog.sh
> b/tests/Functional.nscd/tests/nscd_syslog.sh
> new file mode 100644
> index 0000000..09d2e72
> --- /dev/null
> +++ b/tests/Functional.nscd/tests/nscd_syslog.sh
> @@ -0,0 +1,55 @@
> +#!/bin/sh
> +
> +#  In the target start nscd, and check the messages of /var/log/syslog.
> +#  check the keyword "nscd".
> +
> +test="syslog"
> +
> +. ./fuego_board_function_lib.sh
> +
> +set_init_manager
If we're going to use set_init_manager  in every sub-test script,
it might be more efficient to just call it once in nscd_test.sh
and pass the value of 'init_manager as a shell variable
to all the sub-test scripts.

> +
> +nscd_status=$(exec_service_on_target nscd status)
> +
> +exec_service_on_target nscd stop
> +exec_service_on_target $logger_service stop
> +
> +if [ -f /var/log/syslog ]
> +then
> +    mv /var/log/syslog /var/log/syslog_bak
> +fi
> +
> +restore_target(){
> +    if [ -f /var/log/syslog_bak ]
> +    then
> +        mv /var/log/syslog_bak /var/log/syslog
> +    fi
> +}
> +
> +exec_service_on_target $logger_service restart
> +
> +if exec_service_on_target nscd start
> +then
> +    echo " -> start of nscd succeeded."
> +else
> +    echo " -> start of nscd failed."
> +    echo " -> $test: TEST-FAIL"
> +    restore_target
> +    exit
> +fi
> +
> +sleep 10
> +
> +if cat /var/log/syslog | grep "starting up"
> +then
> +    echo " -> $test: TEST-PASS"
> +else
> +    echo " -> $test: TEST-FAIL"
> +fi
> +
> +if [ "$nscd_status" != "active" ]
> +then
> +    exec_service_on_target nscd stop
> +fi
> +restore_target

This will stop the service, if the status is "unknown",
which might not be correct.  However, I'm fine leaving
this as is for now.

> --
> 1.8.3.1

Thanks.
 -- Tim


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-16  2:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12  7:15 [Fuego] [PATCH] Add test cases of service nscd Wang Mingyu
2019-02-12  7:15 ` [Fuego] [PATCH] Modify the function exec_service_on_target to get status of service Wang Mingyu
2019-02-16  1:30   ` Tim.Bird
2019-02-16  2:04 ` [Fuego] [PATCH] Add test cases of service nscd Tim.Bird

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.