Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions pkg/ddc/alluxio/ufs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ func TestShouldCheckUFS(t *testing.T) {
}
}


// TestPrepareUFS tests the PrepareUFS method of AlluxioEngine.
// This method prepares the underlying file system (UFS) by checking
// the Alluxio master state, mounting UFS, and performing necessary
// metadata synchronization.
//
// Test logic:
// 1. Create multiple test cases to simulate different states of
// AlluxioRuntime, Dataset, and StatefulSet.
// 2. Initialize AlluxioEngine and its dependencies using a fake client.
// 3. Use Monkey Patching to mock the behavior of AlluxioFileUtils methods.
// 4. Call e.PrepareUFS() and verify whether the UFS mounting process
// executes correctly.
// 5. Assert that the returned errors match the expected outcomes.
//
// Parameters:
// - t *testing.T: The testing context provided by the Go testing framework.
func TestPrepareUFS(t *testing.T) {
type fields struct {
runtime *datav1alpha1.AlluxioRuntime
Expand Down
Loading