diff --git a/pkg/ddc/alluxio/operations/base_test.go b/pkg/ddc/alluxio/operations/base_test.go index dc1b3c3f69b..1f3fd4ed795 100644 --- a/pkg/ddc/alluxio/operations/base_test.go +++ b/pkg/ddc/alluxio/operations/base_test.go @@ -479,6 +479,14 @@ func TestAlluxioFileUtils_Ready(t *testing.T) { } } +// TestAlluxioFIleUtils_Du tests the Du method of AlluxioFileUtils. +// It verifies that the method returns an error when command execution fails +// and correctly parses the file size, cached size, and cached percentage +// when the command succeeds. +// +// Test cases: +// - command execution returns an error +// - command execution succeeds and du output is parsed correctly func TestAlluxioFIleUtils_Du(t *testing.T) { ExecCommon := func(a AlluxioFileUtils, command []string, verbose bool) (stdout string, stderr string, err error) { return "File Size In Alluxio Path\n577575561 0 (0%) /hbase", "", nil