Module tests.test_tagging

Functions

def generate_tag_name()
def generate_unordered_tag_names()
def test_tag_basic(client)

Test that applying Tags to Nodes/Disks and retrieving them work as expected. Ensures that Tags are properly validated when updated.

  1. Generate tags and apply to the disk and nodes
  2. Make sure the tags are applied
  3. Try to apply invalid tags to the disk and node. Action will fail.
def test_tag_scheduling(client, node_default_tags)

Test success scheduling with tags

Test prerequisites: - set Replica Node Level Soft Anti-Affinity enabled

Case 1: Don't specify any tags, replica should be scheduled to 3 disks.

Case 2: Use disk tags to select two nodes for all replicas.

Case 3: Use node tags to select two nodes for all replicas.

Case 4: Combine node and disk tags to schedule all replicas on one node.

def test_tag_scheduling_failure(client, node_default_tags)

Test that scheduling fails if no Nodes/Disks with the requested Tags are available.

Case 1: Validate that if specifying nonexist tags in volume, API call will fail.

Case 2:

  1. Specify existing but no node or disk can unsatisfied tags.
  2. Validate the volume will failed the scheduling
def test_tag_scheduling_on_update(client, node_default_tags, volume_name)

Test that Replicas get scheduled if a Node/Disk disks updated with the proper Tags.

Test prerequisites: - set Replica Node Level Soft Anti-Affinity enabled

  1. Create volume with tags that can not be satisfied
  2. Wait for volume to fail scheduling
  3. Update the node and disk with extra tags to satisfy the volume
  4. Verify now volume has been scheduled
  5. Attach the volume and check the replicas has been scheduled properly