From 93ddfdb615f2627c0a3dc1f741f1e66c4e3ac6be Mon Sep 17 00:00:00 2001 From: Jack Lin Date: Wed, 30 Aug 2023 15:30:06 +0800 Subject: [PATCH] test(scheduling): add skeleton for allow empty selector settings ref: longhorn/longhorn 4826 Signed-off-by: Jack Lin --- manager/integration/tests/test_scheduling.py | 66 ++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/manager/integration/tests/test_scheduling.py b/manager/integration/tests/test_scheduling.py index cbe2c1b2df..ea9884892b 100644 --- a/manager/integration/tests/test_scheduling.py +++ b/manager/integration/tests/test_scheduling.py @@ -1722,3 +1722,69 @@ def finalizer(): create_and_wait_statefulset(statefulset) wait_for_statefulset_pods_healthy(statefulset) + + +@pytest.mark.skip(reason="TODO") +def test_allow_empty_node_selector_volume_setting(): # NOQA + """ + Test the global setting allow-empty-node-selector-volume + + If true, a replica of the volume without node selector + can be scheduled on node with tags. + + If false, a replica of the volume without node selector + can not be scheduled on node with tags. + + Setup + - Prepare 3 nodes + - Add `AVAIL` tag to nodes + - Set allow-empty-node-selector-volume to `false` + + When + - Create a Volume with 3 replicas without tag + + Then + - All replicas can not be scheduled to the nodes + + When + - Remove `AVAIL` tag from one of the node + - Set allow-empty-node-selector-volume to `true` + + Then + - Wait for a while for controller to resync the volume, + all replicas can be scheduled to the nodes + """ + pass + + +@pytest.mark.skip(reason="TODO") +def test_allow_empty_disk_selector_volume_setting(): # NOQA + """ + Test the global setting allow-empty-disk-selector-volume + + If true, a replica of the volume without disk selector + can be scheduled on disk with tags. + + If false, a replica of the volume without disk selector + can not be scheduled on disk with tags. + + Setup + - Prepare 3 nodes each with one disk + - Add `AVAIL` tag to every disk + - Set allow-empty-disk-selector-volume to `false` + + When + - Create a Volume with 3 replicas without tag + + Then + - All replicas can not be scheduled to the disks on the nodes + + When + - Remove `AVAIL` tag from one of the node + - Set allow-empty-disk-selector-volume to `true` + + Then + - Wait for a while for controller to resync the volume, + all replicas can be scheduled to the disks on the nodes + """ + pass