directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1730610 - in /directory/apacheds/trunk/installers/src/test/docker: archive.test bin.test deb.test rpm.test
Date Mon, 15 Feb 2016 20:57:34 GMT
Author: seelmann
Date: Mon Feb 15 20:57:34 2016
New Revision: 1730610

URL: http://svn.apache.org/viewvc?rev=1730610&view=rev
Log:
DIRSERVER-2120: Add assertions about exit status to installer tests

Modified:
    directory/apacheds/trunk/installers/src/test/docker/archive.test
    directory/apacheds/trunk/installers/src/test/docker/bin.test
    directory/apacheds/trunk/installers/src/test/docker/deb.test
    directory/apacheds/trunk/installers/src/test/docker/rpm.test

Modified: directory/apacheds/trunk/installers/src/test/docker/archive.test
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers/src/test/docker/archive.test?rev=1730610&r1=1730609&r2=1730610&view=diff
==============================================================================
--- directory/apacheds/trunk/installers/src/test/docker/archive.test (original)
+++ directory/apacheds/trunk/installers/src/test/docker/archive.test Mon Feb 15 20:57:34 2016
@@ -63,13 +63,12 @@ test -f /opt/${DIRNAME}/bin/apacheds.sh
 test -x /opt/${DIRNAME}/bin/apacheds.sh
 test -d /opt/${DIRNAME}/instances/default
 
-# assert not running
+# assert not running: output and exit status
 if [ $HAVE_TTY -eq 1 ]
 then
     /opt/${DIRNAME}/bin/apacheds.sh status | grep "ApacheDS is not running"
-else
-    ! /opt/${DIRNAME}/bin/apacheds.sh status
 fi
+/opt/${DIRNAME}/bin/apacheds.sh status || test $? -ne 0
 
 # install required tools
 apt-get -qq update
@@ -79,13 +78,12 @@ apt-get -qq -y install ldap-utils netcat
 /opt/${DIRNAME}/bin/apacheds.sh start
 wait_for_apacheds_up
 
-# assert running
+# assert running: output and exit status
 if [ $HAVE_TTY -eq 1 ]
 then
     /opt/${DIRNAME}/bin/apacheds.sh status | grep "ApacheDS is running"
-else
-    /opt/${DIRNAME}/bin/apacheds.sh status
 fi
+/opt/${DIRNAME}/bin/apacheds.sh status && test $? -eq 0
 
 # search
 ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
@@ -104,13 +102,12 @@ done
 /opt/${DIRNAME}/bin/apacheds.sh stop
 wait_for_apacheds_down
 
-# assert not running
+# assert not running: output and exit status
 if [ $HAVE_TTY -eq 1 ]
 then
     /opt/${DIRNAME}/bin/apacheds.sh status | grep "ApacheDS is not running"
-else
-    ! /opt/${DIRNAME}/bin/apacheds.sh status
 fi
+/opt/${DIRNAME}/bin/apacheds.sh status || test $? -ne 0
 
 # assert password warning in log
 grep ".*WARN.*admin password.*security breach.*" /opt/${DIRNAME}/instances/default/log/apacheds.log

Modified: directory/apacheds/trunk/installers/src/test/docker/bin.test
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers/src/test/docker/bin.test?rev=1730610&r1=1730609&r2=1730610&view=diff
==============================================================================
--- directory/apacheds/trunk/installers/src/test/docker/bin.test (original)
+++ directory/apacheds/trunk/installers/src/test/docker/bin.test Mon Feb 15 20:57:34 2016
@@ -55,19 +55,22 @@ test -f /opt/${DIRNAME}/LICENSE
 test -f /opt/${DIRNAME}/NOTICE
 test -d /var/lib/${DIRNAME}/default
 
-# assert not running
+# assert not running: output and exit status
 service ${SERVICE_NAME} status | grep "ApacheDS - default is not running"
+service ${SERVICE_NAME} status || test $? -ne 0
 
 # install ldapsearch and tools
 apt-get -qq update
 apt-get -qq -y install ldap-utils netcat
 
 # start
-service ${SERVICE_NAME} start 
+service ${SERVICE_NAME} start
 wait_for_apacheds
 
-# assert running
+# assert running: output and exit status
 service ${SERVICE_NAME} status | grep "ApacheDS - default is running"
+service ${SERVICE_NAME} status && test $? -eq 0
+
 
 # search
 ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
@@ -75,7 +78,7 @@ ldapsearch -h localhost -p 10389 -x -D "
 # restart and search a few times
 for i in 1 2 3
 do
-    service ${SERVICE_NAME} restart 
+    service ${SERVICE_NAME} restart
     wait_for_apacheds
     ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
 done
@@ -83,8 +86,9 @@ done
 # stop
 service ${SERVICE_NAME} stop
 
-# assert not running
+# assert not running: output and exit status
 service ${SERVICE_NAME} status | grep "ApacheDS - default is not running"
+service ${SERVICE_NAME} status || test $? -ne 0
 
 # assert password warning in log
 grep ".*WARN.*admin password.*security breach.*" /var/lib/${DIRNAME}/default/log/apacheds.log

Modified: directory/apacheds/trunk/installers/src/test/docker/deb.test
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers/src/test/docker/deb.test?rev=1730610&r1=1730609&r2=1730610&view=diff
==============================================================================
--- directory/apacheds/trunk/installers/src/test/docker/deb.test (original)
+++ directory/apacheds/trunk/installers/src/test/docker/deb.test Mon Feb 15 20:57:34 2016
@@ -46,19 +46,21 @@ test -f /opt/${DIRNAME}/LICENSE
 test -f /opt/${DIRNAME}/NOTICE
 test -d /var/lib/${DIRNAME}/default
 
-# assert not running
+# assert not running: output and exit status
 service ${SERVICE_NAME} status | grep "ApacheDS - default is not running"
+service ${SERVICE_NAME} status || test $? -ne 0
 
 # install required tools
 apt-get -qq update
 apt-get -qq -y install ldap-utils netcat
 
 # start
-service ${SERVICE_NAME} start 
+service ${SERVICE_NAME} start
 wait_for_apacheds
 
-# assert running
+# assert running: output and exit status
 service ${SERVICE_NAME} status | grep "ApacheDS - default is running"
+service ${SERVICE_NAME} status && test $? -eq 0
 
 # search
 ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
@@ -66,7 +68,7 @@ ldapsearch -h localhost -p 10389 -x -D "
 # restart and search a few times
 for i in 1 2 3
 do
-    service ${SERVICE_NAME} restart 
+    service ${SERVICE_NAME} restart
     wait_for_apacheds
     ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
 done
@@ -74,8 +76,9 @@ done
 # stop
 service ${SERVICE_NAME} stop
 
-# assert not running
+# assert not running: output and exit status
 service ${SERVICE_NAME} status | grep "ApacheDS - default is not running"
+service ${SERVICE_NAME} status || test $? -ne 0
 
 # assert password warning in log
 grep ".*WARN.*admin password.*security breach.*" /var/lib/${DIRNAME}/default/log/apacheds.log

Modified: directory/apacheds/trunk/installers/src/test/docker/rpm.test
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers/src/test/docker/rpm.test?rev=1730610&r1=1730609&r2=1730610&view=diff
==============================================================================
--- directory/apacheds/trunk/installers/src/test/docker/rpm.test (original)
+++ directory/apacheds/trunk/installers/src/test/docker/rpm.test Mon Feb 15 20:57:34 2016
@@ -56,15 +56,17 @@ test -f /opt/${DIRNAME}/LICENSE
 test -f /opt/${DIRNAME}/NOTICE
 test -d /var/lib/${DIRNAME}/default
 
-# assert not running
+# assert not running: output and exit status
 /etc/init.d/${SERVICE_NAME} status | grep "ApacheDS - default is not running"
+/etc/init.d/${SERVICE_NAME} status || test $? -ne 0
 
 # start
-/etc/init.d/${SERVICE_NAME} start 
+/etc/init.d/${SERVICE_NAME} start
 wait_for_apacheds
 
-# assert running
+# assert running: output and exit status
 /etc/init.d/${SERVICE_NAME} status | grep "ApacheDS - default is running"
+/etc/init.d/${SERVICE_NAME} status && test $? -eq 0
 
 # search
 ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
@@ -72,7 +74,7 @@ ldapsearch -h localhost -p 10389 -x -D "
 # restart and search a few times
 for i in 1 2 3
 do
-    /etc/init.d/${SERVICE_NAME} restart 
+    /etc/init.d/${SERVICE_NAME} restart
     wait_for_apacheds
     ldapsearch -h localhost -p 10389 -x -D "uid=admin,ou=system" -w secret -s base -b "dc=example,dc=com"
 done
@@ -80,8 +82,9 @@ done
 # stop
 /etc/init.d/${SERVICE_NAME} stop
 
-# assert not running
+# assert not running: output and exit status
 /etc/init.d/${SERVICE_NAME} status | grep "ApacheDS - default is not running"
+/etc/init.d/${SERVICE_NAME} status || test $? -ne 0
 
 # assert password warning in log
 grep ".*WARN.*admin password.*security breach.*" /var/lib/${DIRNAME}/default/log/apacheds.log



Mime
View raw message