diff --git a/pkg/ddc/alluxio/operations/base_test.go b/pkg/ddc/alluxio/operations/base_test.go index 28382e9f271..a6621527628 100644 --- a/pkg/ddc/alluxio/operations/base_test.go +++ b/pkg/ddc/alluxio/operations/base_test.go @@ -466,6 +466,18 @@ func TestAlluxioFIleUtils_Du(t *testing.T) { } } +// TestAlluxioFileUtils_Count tests the Count method of AlluxioFileUtils. +// This function verifies the Count method's ability to parse the output of the alluxio fs count command +// and handle various error scenarios such as execution errors, negative results, too many lines, +// data number mismatches, and parse errors. +// +// Test cases: +// - EXEC_ERR: Tests handling of command execution errors. +// - NEGATIVE_RES: Tests handling of negative result values. +// - TOO_MANY_LINES: Tests handling of output with too many lines. +// - DATA_NUM: Tests handling of mismatched data numbers. +// - PARSE_ERR: Tests handling of parse errors. +// - FINE: Tests successful parsing of count output. func TestAlluxioFileUtils_Count(t *testing.T) { out1, out2, out3 := 111, 222, 333 mockExec := func(ctx context.Context, p1, p2, p3 string, p4 []string) (stdout string, stderr string, e error) {