]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Improve Debian-style event script unit testing
authorMartin Schwenke <martin@meltin.net>
Fri, 18 Mar 2022 01:55:07 +0000 (12:55 +1100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 24 Jun 2022 09:49:33 +0000 (09:49 +0000)
Tests can be run by hand using different distro styles, such as:

  CTDB_NFS_DISTRO_STYLE=systemd-debian \
    ./tests/run_tests.sh ./tests/UNIT/eventscripts/{06,60}.nfs.*

This fixes known problems for Debian styles, so the tests now pass for
the following values of CTDB_NFS_DISTRO_STYLE:

  systemd-redhat
  sysvinit-redhat
  systemd-debian
  sysvinit-debian

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh

index 2a269910826d707f1dbd97b718ad4254745996cb..f898de45e252ee6173b86ce384176565b68daaa6 100644 (file)
@@ -53,6 +53,7 @@ EOF
                sysvinit-*)
                        service "nfs" force-stopped
                        service "nfslock" force-stopped
+                       service "nfs-kernel-server" force-stopped
                        ;;
                systemd-*)
                        service "nfs-server" force-stopped
@@ -132,7 +133,12 @@ guess_output ()
                sysvinit-redhat)
                        echo "&Starting nfslock: OK"
                        ;;
-               systemd-redhat)
+               sysvinit-debian)
+                       cat <<EOF
+&Starting nfs-kernel-server: OK
+EOF
+                       ;;
+               systemd-*)
                        echo "&Starting rpc-statd: OK"
                        ;;
                esac
@@ -143,6 +149,11 @@ guess_output ()
                        cat <<EOF
 &Starting nfslock: OK
 &Starting nfs: OK
+EOF
+                       ;;
+               sysvinit-debian)
+                       cat <<EOF
+&Starting nfs-kernel-server: OK
 EOF
                        ;;
                systemd-redhat)
@@ -150,6 +161,13 @@ EOF
 &Starting rpc-statd: OK
 &Starting nfs-server: OK
 &Starting rpc-rquotad: OK
+EOF
+                       ;;
+               systemd-debian)
+                       cat <<EOF
+&Starting rpc-statd: OK
+&Starting nfs-server: OK
+&Starting quotarpc: OK
 EOF
                        ;;
                esac
@@ -166,6 +184,13 @@ EOF
                systemd-redhat)
                        echo "Stopping rpc-rquotad: OK"
                        ;;
+               systemd-debian)
+                       if service "quotarpc" status >/dev/null; then
+                               echo "Stopping quotarpc: OK"
+                       else
+                               echo "service: can't stop quotarpc - not running"
+                       fi
+                       ;;
                esac
                ;;
        $CTDB_NFS_CALLOUT\ stop\ status)
@@ -187,6 +212,9 @@ EOF
                systemd-redhat)
                        echo "&Starting rpc-rquotad: OK"
                        ;;
+               systemd-debian)
+                       echo "&Starting quotarpc: OK"
+                       ;;
                esac
                ;;
        $CTDB_NFS_CALLOUT\ start\ status)