go test -v -race ./pkg/... ./test/utils/credentials === RUN TestNewFakeDriver E0417 11:27:36.663068 18101 driver.go:40] Driver name missing --- PASS: TestNewFakeDriver (0.00s) === RUN TestNewCSIDriver E0417 11:27:36.664226 18101 driver.go:40] Driver name missing E0417 11:27:36.664371 18101 driver.go:45] NodeID missing E0417 11:27:36.664413 18101 driver.go:50] Version argument missing, now skip it --- PASS: TestNewCSIDriver (0.00s) === RUN TestGetVolumeCapabilityAccessModes I0417 11:27:36.672454 18101 driver.go:112] Enabling volume access mode: SINGLE_NODE_WRITER --- PASS: TestGetVolumeCapabilityAccessModes (0.01s) === RUN TestValidateControllerServiceRequest I0417 11:27:36.673189 18101 driver.go:93] Enabling controller service capability: CREATE_DELETE_VOLUME I0417 11:27:36.673297 18101 driver.go:93] Enabling controller service capability: PUBLISH_UNPUBLISH_VOLUME I0417 11:27:36.673347 18101 driver.go:93] Enabling controller service capability: GET_CAPACITY I0417 11:27:36.673445 18101 driver.go:93] Enabling controller service capability: LIST_VOLUMES I0417 11:27:36.673513 18101 driver.go:93] Enabling controller service capability: CLONE_VOLUME --- PASS: TestValidateControllerServiceRequest (0.00s) === RUN TestValidateNodeServiceRequest --- PASS: TestValidateNodeServiceRequest (0.00s) === RUN TestAddControllerServiceCapabilities I0417 11:27:36.674848 18101 driver.go:93] Enabling controller service capability: CREATE_DELETE_VOLUME I0417 11:27:36.674949 18101 driver.go:93] Enabling controller service capability: PUBLISH_UNPUBLISH_VOLUME --- PASS: TestAddControllerServiceCapabilities (0.00s) === RUN TestAddNodeServiceCapabilities --- PASS: TestAddNodeServiceCapabilities (0.00s) === RUN TestAddVolumeCapabilityAccessModes I0417 11:27:36.676116 18101 driver.go:112] Enabling volume access mode: MULTI_NODE_MULTI_WRITER I0417 11:27:36.676259 18101 driver.go:112] Enabling volume access mode: SINGLE_NODE_READER_ONLY --- PASS: TestAddVolumeCapabilityAccessModes (0.00s) === RUN TestNewNonBlockingGRPCServer --- PASS: TestNewNonBlockingGRPCServer (0.00s) === RUN TestStart I0417 11:27:37.383341 18101 server.go:118] Listening for connections on address: &net.TCPAddr{IP:net.IP{0x7f, 0x0, 0x0, 0x1}, Port:36463, Zone:""} --- PASS: TestStart (1.01s) === RUN TestServe I0417 11:27:37.685121 18101 server.go:118] Listening for connections on address: &net.TCPAddr{IP:net.IP{0x7f, 0x0, 0x0, 0x1}, Port:36431, Zone:""} --- PASS: TestServe (1.00s) === RUN TestWait --- PASS: TestWait (0.00s) === RUN TestStop --- PASS: TestStop (0.00s) === RUN TestForceStop --- PASS: TestForceStop (0.00s) === RUN TestParseEndpoint --- PASS: TestParseEndpoint (0.00s) === RUN TestLogGRPC === RUN TestLogGRPC/with_secrets === RUN TestLogGRPC/without_secrets --- PASS: TestLogGRPC (0.04s) --- PASS: TestLogGRPC/with_secrets (0.04s) --- PASS: TestLogGRPC/without_secrets (0.00s) === RUN TestNewVolumeCapabilityAccessMode --- PASS: TestNewVolumeCapabilityAccessMode (0.00s) === RUN TestNewControllerServiceCapability --- PASS: TestNewControllerServiceCapability (0.00s) === RUN TestNewNodeServiceCapability --- PASS: TestNewNodeServiceCapability (0.00s) === RUN TestGetLogLevel --- PASS: TestGetLogLevel (0.00s) PASS ok github.com/kubernetes-csi/csi-driver-smb/pkg/csi-common (cached) === RUN TestNewSafeMounter --- PASS: TestNewSafeMounter (0.03s) PASS ok github.com/kubernetes-csi/csi-driver-smb/pkg/mounter (cached) === RUN TestControllerGetCapabilities W0417 14:33:17.681603 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestControllerGetCapabilities (0.00s) === RUN TestCreateVolume W0417 14:33:17.682495 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined === RUN TestCreateVolume/valid_defaults W0417 14:33:17.684623 27496 controllerserver.go:133] failed to unmount smb server: rpc error: code = Internal desc = failed to remove staging path "/home/molson/csi-driver-smb/pkg/smb/test-csi": remove /home/molson/csi-driver-smb/pkg/smb/test-csi: directory not empty === RUN TestCreateVolume/name_empty === RUN TestCreateVolume/Volume_capabilities_missing === RUN TestCreateVolume/block_volume_capability_not_supported === RUN TestCreateVolume/invalid_create_context --- PASS: TestCreateVolume (0.00s) --- PASS: TestCreateVolume/valid_defaults (0.00s) --- PASS: TestCreateVolume/name_empty (0.00s) --- PASS: TestCreateVolume/Volume_capabilities_missing (0.00s) --- PASS: TestCreateVolume/block_volume_capability_not_supported (0.00s) --- PASS: TestCreateVolume/invalid_create_context (0.00s) === RUN TestDeleteVolume W0417 14:33:17.687291 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined === RUN TestDeleteVolume/Volume_ID_missing === RUN TestDeleteVolume/Valid_request --- PASS: TestDeleteVolume (0.00s) --- PASS: TestDeleteVolume/Volume_ID_missing (0.00s) --- PASS: TestDeleteVolume/Valid_request (0.00s) === RUN TestValidateVolumeCapabilities W0417 14:33:17.691113 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestValidateVolumeCapabilities (0.00s) === RUN TestControllerPublishVolume W0417 14:33:17.691835 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestControllerPublishVolume (0.00s) === RUN TestControllerUnpublishVolume W0417 14:33:17.692358 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestControllerUnpublishVolume (0.00s) === RUN TestGetCapacity W0417 14:33:17.692912 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestGetCapacity (0.00s) === RUN TestListVolumes W0417 14:33:17.693446 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestListVolumes (0.00s) === RUN TestControllerExpandVolume W0417 14:33:17.694036 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined === RUN TestControllerExpandVolume/volume_ID_missing === RUN TestControllerExpandVolume/Capacity_Range_missing === RUN TestControllerExpandVolume/Error_=_nil --- PASS: TestControllerExpandVolume (0.00s) --- PASS: TestControllerExpandVolume/volume_ID_missing (0.00s) --- PASS: TestControllerExpandVolume/Capacity_Range_missing (0.00s) --- PASS: TestControllerExpandVolume/Error_=_nil (0.00s) === RUN TestControllerGetVolume W0417 14:33:17.695845 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestControllerGetVolume (0.00s) === RUN TestCreateSnapshot W0417 14:33:17.696430 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestCreateSnapshot (0.00s) === RUN TestDeleteSnapshot W0417 14:33:17.696956 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestDeleteSnapshot (0.00s) === RUN TestListSnapshots W0417 14:33:17.697563 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestListSnapshots (0.00s) === RUN TestGetSmbVolFromID === RUN TestGetSmbVolFromID/correct_volume_id === RUN TestGetSmbVolFromID/correct_volume_id_with_// === RUN TestGetSmbVolFromID/correct_volume_id_with_empty_uuid === RUN TestGetSmbVolFromID/correct_volume_id_with_multiple_base_directories === RUN TestGetSmbVolFromID/existing_sub_dir === RUN TestGetSmbVolFromID/valid_request_nested_ondelete_retain === RUN TestGetSmbVolFromID/valid_request_nested_ondelete_archive === RUN TestGetSmbVolFromID/incorrect_volume_id --- PASS: TestGetSmbVolFromID (0.00s) --- PASS: TestGetSmbVolFromID/correct_volume_id (0.00s) --- PASS: TestGetSmbVolFromID/correct_volume_id_with_// (0.00s) --- PASS: TestGetSmbVolFromID/correct_volume_id_with_empty_uuid (0.00s) --- PASS: TestGetSmbVolFromID/correct_volume_id_with_multiple_base_directories (0.00s) --- PASS: TestGetSmbVolFromID/existing_sub_dir (0.00s) --- PASS: TestGetSmbVolFromID/valid_request_nested_ondelete_retain (0.00s) --- PASS: TestGetSmbVolFromID/valid_request_nested_ondelete_archive (0.00s) --- PASS: TestGetSmbVolFromID/incorrect_volume_id (0.00s) === RUN TestGetVolumeIDFromSmbVol --- PASS: TestGetVolumeIDFromSmbVol (0.00s) === RUN TestGetInternalMountPath --- PASS: TestGetInternalMountPath (0.00s) === RUN TestNewSMBVolume --- PASS: TestNewSMBVolume (0.00s) === RUN TestIsValidVolumeCapabilities --- PASS: TestIsValidVolumeCapabilities (0.00s) === RUN TestCopyFromVolume W0417 14:33:17.703734 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined W0417 14:33:17.708973 27496 controllerserver.go:419] failed to unmount dst nfs server: rpc error: code = Internal desc = failed to remove staging path "/home/molson/csi-driver-smb/pkg/smb/pvc-4729891a-f57e-4982-9c60-e9884af1be2f": remove /home/molson/csi-driver-smb/pkg/smb/pvc-4729891a-f57e-4982-9c60-e9884af1be2f: directory not empty W0417 14:33:17.709996 27496 controllerserver.go:411] failed to unmount nfs server: rpc error: code = Internal desc = failed to remove staging path "/home/molson/csi-driver-smb/pkg/smb/test-csi": remove /home/molson/csi-driver-smb/pkg/smb/test-csi: directory not empty --- PASS: TestCopyFromVolume (0.01s) === RUN TestMount W0417 14:33:17.710587 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestMount (0.00s) === RUN TestMountSensitive W0417 14:33:17.711054 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestMountSensitive (0.00s) === RUN TestIsLikelyNotMountPoint W0417 14:33:17.711411 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestIsLikelyNotMountPoint (0.00s) === RUN TestGetPluginInfo W0417 14:33:17.711831 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined W0417 14:33:17.711883 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined W0417 14:33:17.711986 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestGetPluginInfo (0.00s) === RUN TestProbe W0417 14:33:17.712404 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestProbe (0.00s) === RUN TestGetPluginCapabilities W0417 14:33:17.712755 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestGetPluginCapabilities (0.00s) === RUN TestNodeStageVolume W0417 14:33:17.713394 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestNodeStageVolume (0.00s) === RUN TestNodeGetInfo W0417 14:33:17.715685 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestNodeGetInfo (0.00s) === RUN TestNodeGetCapabilities W0417 14:33:17.716032 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestNodeGetCapabilities (0.00s) === RUN TestNodeExpandVolume W0417 14:33:17.716411 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestNodeExpandVolume (0.00s) === RUN TestNodePublishVolume W0417 14:33:17.717351 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined E0417 14:33:17.717678 27496 nodeserver.go:519] MakeDir failed on target: /home/molson/csi-driver-smb/pkg/smb/smb.go (mkdir /home/molson/csi-driver-smb/pkg/smb/smb.go: not a directory) --- PASS: TestNodePublishVolume (0.00s) === RUN TestNodeUnpublishVolume W0417 14:33:17.719290 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestNodeUnpublishVolume (0.00s) === RUN TestNodeUnstageVolume W0417 14:33:17.719995 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestNodeUnstageVolume (0.00s) === RUN TestEnsureMountPoint W0417 14:33:17.721657 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined W0417 14:33:17.721812 27496 nodeserver.go:509] ReadDir ./false_is_likely_target failed with open ./false_is_likely_target: no such file or directory, unmount this directory E0417 14:33:17.721941 27496 nodeserver.go:519] MakeDir failed on target: ./smb.go (mkdir ./smb.go: not a directory) --- PASS: TestEnsureMountPoint (0.00s) === RUN TestMakeDir --- PASS: TestMakeDir (0.00s) === RUN TestNodeGetVolumeStats W0417 14:33:17.723787 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestNodeGetVolumeStats (0.00s) === RUN TestCheckGidPresentInMountFlags --- PASS: TestCheckGidPresentInMountFlags (0.00s) === RUN TestVolumeKerberosCacheName --- PASS: TestVolumeKerberosCacheName (0.00s) === RUN TestHasKerberosMountOption --- PASS: TestHasKerberosMountOption (0.00s) === RUN TestGetCredUID --- PASS: TestGetCredUID (0.00s) === RUN TestGetKerberosCache --- PASS: TestGetKerberosCache (0.00s) === RUN TestNodePublishVolumeIdempotentMount --- PASS: TestNodePublishVolumeIdempotentMount (0.00s) === RUN TestEnableGroupRWX --- PASS: TestEnableGroupRWX (0.00s) === RUN TestRaiseGroupRWXInMountFlags --- PASS: TestRaiseGroupRWXInMountFlags (0.00s) === RUN TestNewFakeDriver W0417 14:33:17.726665 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestNewFakeDriver (0.00s) === RUN TestIsCorruptedDir --- PASS: TestIsCorruptedDir (0.00s) === RUN TestRun === RUN TestRun/Successful_run W0417 14:33:17.727882 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined I0417 14:33:17.735400 27496 driver.go:93] Enabling controller service capability: CREATE_DELETE_VOLUME I0417 14:33:17.735509 27496 driver.go:93] Enabling controller service capability: SINGLE_NODE_MULTI_WRITER I0417 14:33:17.735542 27496 driver.go:93] Enabling controller service capability: CLONE_VOLUME I0417 14:33:17.735566 27496 driver.go:93] Enabling controller service capability: EXPAND_VOLUME I0417 14:33:17.735588 27496 driver.go:93] Enabling controller service capability: PUBLISH_UNPUBLISH_VOLUME I0417 14:33:17.735633 27496 driver.go:112] Enabling volume access mode: SINGLE_NODE_WRITER I0417 14:33:17.735694 27496 driver.go:112] Enabling volume access mode: SINGLE_NODE_READER_ONLY I0417 14:33:17.735754 27496 driver.go:112] Enabling volume access mode: SINGLE_NODE_SINGLE_WRITER I0417 14:33:17.735792 27496 driver.go:112] Enabling volume access mode: SINGLE_NODE_MULTI_WRITER I0417 14:33:17.735818 27496 driver.go:112] Enabling volume access mode: MULTI_NODE_READER_ONLY I0417 14:33:17.735878 27496 driver.go:112] Enabling volume access mode: MULTI_NODE_SINGLE_WRITER I0417 14:33:17.735943 27496 driver.go:112] Enabling volume access mode: MULTI_NODE_MULTI_WRITER === RUN TestRun/Successful_run_with_node_ID_missing I0417 14:33:17.760870 27496 server.go:118] Listening for connections on address: &net.TCPAddr{IP:net.IP{0x7f, 0x0, 0x0, 0x1}, Port:42355, Zone:""} W0417 14:33:17.761561 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined I0417 14:33:17.769074 27496 driver.go:93] Enabling controller service capability: CREATE_DELETE_VOLUME I0417 14:33:17.769228 27496 driver.go:93] Enabling controller service capability: SINGLE_NODE_MULTI_WRITER I0417 14:33:17.769290 27496 driver.go:93] Enabling controller service capability: CLONE_VOLUME I0417 14:33:17.769378 27496 driver.go:93] Enabling controller service capability: EXPAND_VOLUME I0417 14:33:17.769462 27496 driver.go:93] Enabling controller service capability: PUBLISH_UNPUBLISH_VOLUME I0417 14:33:17.769510 27496 driver.go:112] Enabling volume access mode: SINGLE_NODE_WRITER I0417 14:33:17.769546 27496 driver.go:112] Enabling volume access mode: SINGLE_NODE_READER_ONLY I0417 14:33:17.769620 27496 driver.go:112] Enabling volume access mode: SINGLE_NODE_SINGLE_WRITER I0417 14:33:17.769655 27496 driver.go:112] Enabling volume access mode: SINGLE_NODE_MULTI_WRITER I0417 14:33:17.769729 27496 driver.go:112] Enabling volume access mode: MULTI_NODE_READER_ONLY I0417 14:33:17.769770 27496 driver.go:112] Enabling volume access mode: MULTI_NODE_SINGLE_WRITER I0417 14:33:17.769806 27496 driver.go:112] Enabling volume access mode: MULTI_NODE_MULTI_WRITER I0417 14:33:17.770397 27496 server.go:118] Listening for connections on address: &net.TCPAddr{IP:net.IP{0x7f, 0x0, 0x0, 0x1}, Port:42843, Zone:""} --- PASS: TestRun (0.04s) --- PASS: TestRun/Successful_run (0.03s) --- PASS: TestRun/Successful_run_with_node_ID_missing (0.01s) === RUN TestGetMountOptions --- PASS: TestGetMountOptions (0.00s) === RUN TestHasGuestMountOptions --- PASS: TestHasGuestMountOptions (0.00s) === RUN TestSetKeyValueInMap --- PASS: TestSetKeyValueInMap (0.00s) === RUN TestReplaceWithMap --- PASS: TestReplaceWithMap (0.00s) === RUN TestValidateOnDeleteValue --- PASS: TestValidateOnDeleteValue (0.00s) === RUN TestAppendMountOptions --- PASS: TestAppendMountOptions (0.00s) === RUN TestGetRootPath --- PASS: TestGetRootPath (0.00s) === RUN TestGetKubeConfig --- PASS: TestGetKubeConfig (0.01s) === RUN TestGetUserNamePasswordFromSecret W0417 14:33:17.779970 27496 smb.go:167] get kubeconfig() failed with error: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined --- PASS: TestGetUserNamePasswordFromSecret (0.00s) === RUN TestGetVersion --- PASS: TestGetVersion (0.00s) === RUN TestGetVersionYAML --- PASS: TestGetVersionYAML (0.00s) PASS ok github.com/kubernetes-csi/csi-driver-smb/pkg/smb (cached) === RUN TestWaitUntilTimeout --- PASS: TestWaitUntilTimeout (1.00s) === RUN TestSetKeyValueInMap --- PASS: TestSetKeyValueInMap (0.00s) PASS ok github.com/kubernetes-csi/csi-driver-smb/pkg/util (cached) === RUN TestCreateAzureCredentialFileOnAzureChinaCloud === RUN TestCreateAzureCredentialFileOnAzureChinaCloud/WithAzureCredentials 2025/04/17 11:28:49 Running in Prow, converting AZURE_CREDENTIALS to AZURE_CREDENTIAL_FILE 2025/04/17 11:28:49 Reading credentials file /tmp/azure.toml1589623602 === RUN TestCreateAzureCredentialFileOnAzureChinaCloud/WithEnvironmentVariables --- PASS: TestCreateAzureCredentialFileOnAzureChinaCloud (0.00s) --- PASS: TestCreateAzureCredentialFileOnAzureChinaCloud/WithAzureCredentials (0.00s) --- PASS: TestCreateAzureCredentialFileOnAzureChinaCloud/WithEnvironmentVariables (0.00s) === RUN TestCreateAzureCredentialFileOnAzurePublicCloud === RUN TestCreateAzureCredentialFileOnAzurePublicCloud/WithAzureCredentials 2025/04/17 11:28:49 Running in Prow, converting AZURE_CREDENTIALS to AZURE_CREDENTIAL_FILE 2025/04/17 11:28:49 Reading credentials file /tmp/azure.toml2045443204 === RUN TestCreateAzureCredentialFileOnAzurePublicCloud/WithEnvironmentVariables --- PASS: TestCreateAzureCredentialFileOnAzurePublicCloud (0.01s) --- PASS: TestCreateAzureCredentialFileOnAzurePublicCloud/WithAzureCredentials (0.00s) --- PASS: TestCreateAzureCredentialFileOnAzurePublicCloud/WithEnvironmentVariables (0.00s) PASS ok github.com/kubernetes-csi/csi-driver-smb/test/utils/credentials (cached) hack/verify-all.sh Verifying gofmt No issue found Verifying govet Done Reading package lists... checking yamllint under path: deploy/*.yaml ... checking yamllint under path: deploy/example/*.yaml ... checking yamllint under path: deploy/example/windows/*.yaml ... checking yamllint under path: deploy/example/smb-provisioner/*.yaml ... checking yamllint under path: deploy/example/metrics/*.yaml ... checking yamllint under path: deploy/example/cloning/*.yaml ... Congratulations! All Yaml files have been linted. begin to verify chart tgz files ... diff --git a/pkg/smb/controllerserver.go b/pkg/smb/controllerserver.go index dbc843eaf..ead2c14ee 100644 --- a/pkg/smb/controllerserver.go +++ b/pkg/smb/controllerserver.go @@ -86,17 +86,17 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) return nil, status.Error(codes.InvalidArgument, err.Error()) } - secrets := req.GetSecrets() - username := strings.TrimSpace(secrets["username"]) - password := strings.TrimSpace(secrets["password"]) - if username != "" || password != "" { - hashKey := fmt.Sprintf("%s|%s", username, password) - hash := sha256.Sum256([]byte(hashKey)) - hashStr := hex.EncodeToString(hash[:8]) - smbVol.id = fmt.Sprintf("%s#cred=%s", getVolumeIDFromSmbVol(smbVol), hashStr) - } else { - smbVol.id = getVolumeIDFromSmbVol(smbVol) - } + secrets := req.GetSecrets() + username := strings.TrimSpace(secrets["username"]) + password := strings.TrimSpace(secrets["password"]) + if username != "" || password != "" { + hashKey := fmt.Sprintf("%s|%s", username, password) + hash := sha256.Sum256([]byte(hashKey)) + hashStr := hex.EncodeToString(hash[:8]) + smbVol.id = fmt.Sprintf("%s#cred=%s", getVolumeIDFromSmbVol(smbVol), hashStr) + } else { + smbVol.id = getVolumeIDFromSmbVol(smbVol) + } createSubDir := len(secrets) > 0 if len(smbVol.uuid) > 0 { diff --git a/pkg/smb/controllerserver_test.go b/pkg/smb/controllerserver_test.go index 64af250ef..177414702 100644 --- a/pkg/smb/controllerserver_test.go +++ b/pkg/smb/controllerserver_test.go @@ -23,6 +23,7 @@ import ( "path/filepath" "reflect" "runtime" + "strings" "testing" "github.com/container-storage-interface/spec/lib/go/csi" @@ -203,7 +204,11 @@ func TestCreateVolume(t *testing.T) { if !test.expectErr && err != nil { t.Errorf("test %q failed: %v", test.name, err) } - if !reflect.DeepEqual(resp, test.resp) { + if !test.expectErr && test.name == "valid defaults" { + if resp.Volume == nil || !strings.HasPrefix(resp.Volume.VolumeId, "test-server/baseDir#test-csi###cred=") { + t.Errorf("test %q failed: got volume ID %q, expected it to start with prefix %q", test.name, resp.Volume.VolumeId, "test-server/baseDir#test-csi###cred=") + } + } else if !reflect.DeepEqual(resp, test.resp) { t.Errorf("test %q failed: got resp %+v, expected %+v", test.name, resp, test.resp) } if !test.expectErr { diff --git a/pkg/smb/nodeserver.go b/pkg/smb/nodeserver.go index e201e8a16..ec178ad90 100644 --- a/pkg/smb/nodeserver.go +++ b/pkg/smb/nodeserver.go @@ -109,7 +109,6 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu return &csi.NodePublishVolumeResponse{}, nil } - func (d *Driver) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error) { volumeID := req.GetVolumeId() if len(volumeID) == 0 { @@ -121,7 +120,7 @@ func (d *Driver) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVo } klog.V(2).Infof("NodeUnpublishVolume: unmounting volume %s from %s", volumeID, targetPath) - + notMnt, err := d.mounter.IsLikelyNotMountPoint(targetPath) if err != nil && !os.IsNotExist(err) { return nil, status.Errorf(codes.Internal, "failed to check mount point %q: %v", targetPath, err) @@ -365,7 +364,6 @@ func (d *Driver) NodeUnstageVolume(_ context.Context, req *csi.NodeUnstageVolume return &csi.NodeUnstageVolumeResponse{}, nil } - // NodeGetCapabilities return the capabilities of the Node plugin func (d *Driver) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error) { return &csi.NodeGetCapabilitiesResponse{