File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -992,6 +992,29 @@ func TestUpdateMountTime(t *testing.T) {
992992 }
993993}
994994
995+ // TestCheckIfRemountRequired tests the checkIfRemountRequired function in AlluxioEngine.
996+ // It verifies whether the system correctly identifies when a remount is required based on:
997+ // - Runtime's last mount time
998+ // - Pod's container start time
999+ // - Dataset mount configurations
1000+ //
1001+ // Test cases:
1002+ // 1. When pod started AFTER last mount time (expect remount)
1003+ // - Runtime mount time: yesterday
1004+ // - Pod start time: yesterday + 1 day
1005+ // - Expected: ["/path"] (remount required)
1006+ // 2. When pod started BEFORE last mount time (expect no remount)
1007+ // - Runtime mount time: yesterday
1008+ // - Pod start time: yesterday - 1 day
1009+ // - Expected: [] (no remount needed)
1010+ //
1011+ // The test:
1012+ // - Creates mock runtime, pod and dataset objects
1013+ // - Initializes fake Kubernetes client with test objects
1014+ // - Mocks AlluxioFileUtils operations:
1015+ // - Always reports Ready() = true
1016+ // - FindUnmountedAlluxioPaths() returns original paths
1017+ // - Compares actual remount paths with expected results
9951018func TestCheckIfRemountRequired (t * testing.T ) {
9961019 yesterday := time .Now ().AddDate (0 , 0 , - 1 )
9971020
You can’t perform that action at this time.
0 commit comments