@@ -684,6 +684,8 @@ test_clustering_storage() {
684684 driver_config=" source=incustest-$( basename " ${TEST_DIR} " ) -pool1"
685685 elif [ " ${poolDriver} " = " linstor" ]; then
686686 driver_config=" source=incustest-$( basename " ${TEST_DIR} " | sed ' s/\./__/g' ) -pool1"
687+ elif [ " ${poolDriver} " = " nfs" ]; then
688+ driver_config=" source=$INCUS_NFS_SHARE /$( basename " ${TEST_DIR} " ) "
687689 fi
688690
689691 # Define storage pools on the two nodes
@@ -749,11 +751,14 @@ test_clustering_storage() {
749751 # For ceph volume the source field is the name of the underlying ceph pool
750752 source1=" incustest-$( basename " ${TEST_DIR} " ) "
751753 source2=" ${source1} "
752- fi
753- if [ " ${poolDriver} " = " linstor" ]; then
754+ elif [ " ${poolDriver} " = " linstor" ]; then
754755 # For linstor the source field is the name of the underlying linstor resource group
755756 source1=" incustest-$( basename " ${TEST_DIR} " | sed ' s/\./__/g' ) "
756757 source2=" ${source1} "
758+ elif [ " ${poolDriver} " = " nfs" ]; then
759+ # For nfs the source field is the name of the underlying nfs share
760+ source1=" $INCUS_NFS_SHARE /$( basename " ${TEST_DIR} " ) "
761+ source2=" ${source1} "
757762 fi
758763 INCUS_DIR=" ${INCUS_ONE_DIR} " incus storage show pool1 --target node1 | grep source | grep -q " ${source1} "
759764 INCUS_DIR=" ${INCUS_ONE_DIR} " incus storage show pool1 --target node2 | grep source | grep -q " ${source2} "
@@ -766,8 +771,8 @@ test_clustering_storage() {
766771 ! INCUS_DIR=" ${INCUS_ONE_DIR} " incus storage show pool1 | grep -q rsync.bwlimit || false
767772 fi
768773
769- if [ " ${poolDriver} " = " ceph" ] || [ " ${poolDriver} " = " linstor" ]; then
770- # Test migration of ceph- and linstor -based containers
774+ if [ " ${poolDriver} " = " ceph" ] || [ " ${poolDriver} " = " linstor" ] || [ " ${poolDriver} " = " nfs " ] ; then
775+ # Test migration of ceph-, linstor-, and nfs -based containers
771776 INCUS_DIR=" ${INCUS_TWO_DIR} " ensure_import_testimage
772777 INCUS_DIR=" ${INCUS_ONE_DIR} " incus launch --target node2 -s pool1 testimage foo
773778
@@ -796,7 +801,7 @@ test_clustering_storage() {
796801
797802 # If the driver has the same per-node storage pool config (e.g. size), make sure it's included in the
798803 # member_config, and actually added to a joining node so we can validate it.
799- if [ " ${poolDriver} " = " zfs" ] || [ " ${poolDriver} " = " btrfs" ] || [ " ${poolDriver} " = " ceph" ] || [ " ${poolDriver} " = " lvm" ] || [ " ${poolDriver} " = " linstor" ]; then
804+ if [ " ${poolDriver} " = " zfs" ] || [ " ${poolDriver} " = " btrfs" ] || [ " ${poolDriver} " = " ceph" ] || [ " ${poolDriver} " = " lvm" ] || [ " ${poolDriver} " = " linstor" ] || [ " ${poolDriver} " = " nfs " ] ; then
800805 # Spawn a third node
801806 setup_clustering_netns 3
802807 INCUS_THREE_DIR=$( mktemp -d -p " ${TEST_DIR} " XXX)
@@ -830,12 +835,12 @@ test_clustering_storage() {
830835 done
831836
832837 # Other storage backends will be finished with the third node, so we can remove it.
833- if [ " ${poolDriver} " != " ceph" ] && [ " ${poolDriver} " != " linstor" ]; then
838+ if [ " ${poolDriver} " != " ceph" ] && [ " ${poolDriver} " != " linstor" ] && [ " ${poolDriver} " != " nfs " ] ; then
834839 INCUS_DIR=" ${INCUS_ONE_DIR} " incus cluster remove node3 --yes
835840 fi
836841 fi
837842
838- if [ " ${poolDriver} " = " ceph" ] || [ " ${poolDriver} " = " linstor" ]; then
843+ if [ " ${poolDriver} " = " ceph" ] || [ " ${poolDriver} " = " linstor" ] || [ " ${poolDriver} " = " nfs " ] ; then
839844 # Move the container to node3, renaming it
840845 INCUS_DIR=" ${INCUS_TWO_DIR} " incus move foo bar --target node3
841846 INCUS_DIR=" ${INCUS_TWO_DIR} " incus info bar | grep -q " Location: node3"
@@ -925,7 +930,7 @@ test_clustering_storage() {
925930 INCUS_DIR=" ${INCUS_ONE_DIR} " incus storage delete pool1
926931 ! INCUS_DIR=" ${INCUS_ONE_DIR} " incus storage list | grep -q pool1 || false
927932
928- if [ " ${poolDriver} " != " ceph" ] && [ " ${poolDriver} " != " linstor" ]; then
933+ if [ " ${poolDriver} " != " ceph" ] && [ " ${poolDriver} " != " linstor" ] && [ " ${poolDriver} " != " nfs " ] ; then
929934 # Create a volume on node1
930935 INCUS_DIR=" ${INCUS_ONE_DIR} " incus storage volume create data web
931936 INCUS_DIR=" ${INCUS_ONE_DIR} " incus storage volume list data | grep web | grep -q node1
0 commit comments