From 5b601c97e2fcc8e6e94f255b6a74d541d225a1f3 Mon Sep 17 00:00:00 2001 From: xkxkzzZ <221220074@smail.nju.edu.cn> Date: Tue, 11 Mar 2025 19:10:36 +0800 Subject: [PATCH] Add Notation to TestGetHCFSStatus in pkg/ddc/alluxio/hcfs_test.go. Signed-off-by: xkxkzzZ <221220074@smail.nju.edu.cn> --- pkg/ddc/alluxio/hcfs_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/ddc/alluxio/hcfs_test.go b/pkg/ddc/alluxio/hcfs_test.go index 0510e6ef44a..3cec087bd44 100644 --- a/pkg/ddc/alluxio/hcfs_test.go +++ b/pkg/ddc/alluxio/hcfs_test.go @@ -49,6 +49,12 @@ func newAlluxioEngineHCFS(client client.Client, name string, namespace string) * return engine } +// TestGetHCFSStatus tests various scenarios of the GetHCFSStatus method. +// This test verifies the logic of retrieving HCFS status, covering the following cases: +// 1. In the normal case, it should correctly return the expected endpoint and filesystem version. +// 2. When the service is not registered, GetHCFSStatus should return an appropriate error. +// 3. When an error occurs during configuration retrieval, GetHCFSStatus should return the error. +// The test uses mocks of kubeclient.ExecCommandInContainerWithFullOutput to simulate different outputs. func TestGetHCFSStatus(t *testing.T) { mockExecCommon := func(ctx context.Context, podName string, containerName string, namespace string, cmd []string) (stdout string, stderr string, e error) { return "conf", "", nil