Skip to content

Commit

Permalink
Merge pull request #1519 from ChanYiLin/LH4826_allow_empty_selector_s…
Browse files Browse the repository at this point in the history
…etting

test(scheduling): add skeleton for allow empty selector settings
  • Loading branch information
khushboo-rancher authored Nov 14, 2023
2 parents 7a644ba + 39687da commit 41d54e8
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions manager/integration/tests/test_scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,38 @@ def finalizer():


@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


def test_global_disk_soft_anti_affinity(): # NOQA
"""
1. When Replica Disk Soft Anti-Affinity is false, it should be impossible
Expand Down Expand Up @@ -1775,6 +1807,38 @@ def test_global_disk_soft_anti_affinity(): # NOQA


@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


def test_volume_disk_soft_anti_affinity(): # NOQA
"""
1. When Replica Disk Soft Anti-Affinity is disabled, it should be
Expand Down

0 comments on commit 41d54e8

Please sign in to comment.