Skip to content

Commit 427f5c9

Browse files
Merge pull request #6285 from kasturinarra/ushift_6584
USHIFT-6584: Automate lvmd config truncation regression test
2 parents 98e71ec + 3b0d152 commit 427f5c9

2 files changed

Lines changed: 44 additions & 7 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
device-classes:
2+
- default: true
3+
name: "userdev"
4+
volume-group: rhel
5+
spare-gb: 10
6+
socket-name: /run/lvmd/lvmd.socket

test/suites/storage/snapshot.robot

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ Suite Teardown Test Suite Teardown
1515

1616

1717
*** Variables ***
18-
${POD_NAME_STATIC} base
19-
${TEST_DATA} FOOBAR
20-
${SOURCE_KUSTOMIZE} assets/kustomizations/patches/pvc-thin
21-
${RESTORE_KUSTOMIZE} assets/kustomizations/patches/pvc-from-snapshot
22-
${SNAPSHOT} assets/storage/snapshot.yaml
23-
${STORAGE_CLASS} assets/storage/storage-class-thin.yaml
24-
${SNAPSHOT_CLASS} assets/storage/volume-snapshot-class.yaml
18+
${POD_NAME_STATIC} base
19+
${TEST_DATA} FOOBAR
20+
${SOURCE_KUSTOMIZE} assets/kustomizations/patches/pvc-thin
21+
${RESTORE_KUSTOMIZE} assets/kustomizations/patches/pvc-from-snapshot
22+
${SNAPSHOT} assets/storage/snapshot.yaml
23+
${STORAGE_CLASS} assets/storage/storage-class-thin.yaml
24+
${SNAPSHOT_CLASS} assets/storage/volume-snapshot-class.yaml
25+
${RUNTIME_LVMD_CONFIG} /var/lib/microshift/lvms/lvmd.yaml
26+
${SMALL_LVMD_ASSET} assets/storage/lvmd-small.yaml
2527

2628

2729
*** Test Cases ***
@@ -37,6 +39,34 @@ Snapshotter Smoke Test
3739
Should Be Equal As Strings ${TESTDATA} ${data}
3840
[Teardown] Test Case Teardown
3941

42+
Lvmd Runtime Config Is Valid After Replacing With Smaller Config
43+
[Documentation] Verify that replacing a larger lvmd.yaml with a smaller one
44+
... produces a valid, correctly truncated runtime config at
45+
... /var/lib/microshift/lvms/lvmd.yaml with no leftover garbage bytes.
46+
... Regression test for USHIFT-6584.
47+
[Tags] ushift-6584
48+
49+
${small_cfg}= OperatingSystem.Get File ${SMALL_LVMD_ASSET}
50+
Upload Lvmd Config ${small_cfg}
51+
Restart MicroShift
52+
Wait For MicroShift Healthcheck Success
53+
54+
# Compare user config and runtime config are identical
55+
${user_content}= Command Should Work cat /etc/microshift/lvmd.yaml
56+
${runtime_content}= Command Should Work cat ${RUNTIME_LVMD_CONFIG}
57+
Should Be Equal As Strings ${user_content} ${runtime_content}
58+
... Runtime config does not match user config - file was not properly truncated
59+
60+
# Verify openshift-storage pods are healthy with the new config
61+
Named Deployment Should Be Available lvms-operator openshift-storage 5m
62+
Wait Until Resource Exists daemonset vg-manager openshift-storage 5m
63+
Named Daemonset Should Be Available vg-manager openshift-storage 5m
64+
65+
[Teardown] Run Keywords
66+
... Upload Lvmd Config ${EXTENDED_LVMD_CONFIG}
67+
... AND Restart MicroShift
68+
... AND Wait For MicroShift Healthcheck Success
69+
4070

4171
*** Keywords ***
4272
Test Suite Setup
@@ -46,6 +76,7 @@ Test Suite Setup
4676
Create Thin Storage Pool
4777
Save Lvmd Config
4878
${config}= Extend Lvmd Config
79+
VAR ${EXTENDED_LVMD_CONFIG}= ${config} scope=SUITE
4980
Upload Lvmd Config ${config}
5081
Oc Apply -f ${STORAGE_CLASS} -f ${SNAPSHOT_CLASS}
5182
Restart Microshift

0 commit comments

Comments
 (0)