Skip to content

Commit d461da0

Browse files
committed
fix
1 parent 3d5ba3e commit d461da0

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.github/workflows/windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
integration_tests:
55
strategy:
66
matrix:
7-
go: ['1.22']
7+
go: ['1.21']
88
platform: [windows-latest]
99
runs-on: ${{ matrix.platform }}
1010
steps:
@@ -31,11 +31,11 @@ jobs:
3131
Write-Output "getting named pipes"
3232
[System.IO.Directory]::GetFiles("\\.\\pipe\\")
3333
$env:CSI_PROXY_GH_ACTIONS="TRUE"
34-
go test -timeout 20m -v -race ./integrationtests/...
34+
go test -timeout 5m -v -race ./integrationtests/...
3535
unit_tests:
3636
strategy:
3737
matrix:
38-
go: ['1.22']
38+
go: ['1.21']
3939
platform: [windows-latest]
4040
runs-on: ${{ matrix.platform }}
4141
steps:
@@ -53,7 +53,7 @@ jobs:
5353
bump_version_test:
5454
strategy:
5555
matrix:
56-
go: ['1.22']
56+
go: ['1.21']
5757
platform: [ubuntu-latest]
5858
runs-on: ${{ matrix.platform }}
5959
steps:

integrationtests/smb_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ func setupUser(username, password string) error {
3535
cmd := exec.Command("powershell", "/c", cmdLine)
3636
cmd.Env = append(os.Environ(),
3737
fmt.Sprintf("username=%s", username),
38-
fmt.Sprintf("password=%s", password),
39-
"PSModulePath=") // Set the PSModulePath environment variable
38+
fmt.Sprintf("password=%s", password))
4039
if output, err := cmd.CombinedOutput(); err != nil {
4140
return fmt.Errorf("setupUser failed: %v, output: %q", err, string(output))
4241
}

integrationtests/smb_v1alpha1_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import (
1313
)
1414

1515
func v1alpha1SmbTests(t *testing.T) {
16+
t.Logf("Before NewClient")
1617
client, err := client.NewClient()
1718
if err != nil {
1819
t.Fatalf("Fail to get smb API group client %v", err)
1920
}
2021
defer client.Close()
22+
t.Logf("After NewClient")
2123

2224
username := randomString(5)
2325
password := randomString(10) + "!"
@@ -26,16 +28,21 @@ func v1alpha1SmbTests(t *testing.T) {
2628

2729
localPath := fmt.Sprintf("C:\\localpath%s", randomString(5))
2830

31+
t.Logf("Before setupUser")
2932
if err = setupUser(username, password); err != nil {
3033
t.Fatalf("TestSmbAPIGroup %v", err)
3134
}
3235
defer removeUser(t, username)
36+
t.Logf("After setupUser")
3337

38+
t.Logf("Before setupSmbShare")
3439
if err = setupSmbShare(smbShare, sharePath, username); err != nil {
3540
t.Fatalf("TestSmbAPIGroup %v", err)
3641
}
3742
defer removeSmbShare(t, smbShare)
43+
t.Logf("After setupSmbShare")
3844

45+
t.Logf("Before NewSmbGlobalMapping")
3946
hostname, err := os.Hostname()
4047
assert.Nil(t, err)
4148

@@ -51,23 +58,34 @@ func v1alpha1SmbTests(t *testing.T) {
5158
if err != nil {
5259
t.Fatalf("TestSmbAPIGroup %v", err)
5360
}
61+
t.Logf("After NewSmbGlobalMapping")
5462

63+
t.Logf("Before getSmbGlobalMapping")
5564
err = getSmbGlobalMapping(remotePath)
5665
assert.Nil(t, err)
66+
t.Logf("After getSmbGlobalMapping")
5767

68+
t.Logf("Before writeReadFile")
5869
err = writeReadFile(remotePath)
5970
assert.Nil(t, err)
71+
t.Logf("After writeReadFile")
6072

73+
t.Logf("Before RemoveSmbGlobalMapping")
6174
unmountSmbShareReq := &v1alpha1.RemoveSmbGlobalMappingRequest{
6275
RemotePath: remotePath,
6376
}
6477
_, err = client.RemoveSmbGlobalMapping(context.Background(), unmountSmbShareReq)
6578
if err != nil {
6679
t.Fatalf("TestSmbAPIGroup %v", err)
6780
}
81+
t.Logf("After RemoveSmbGlobalMapping")
82+
t.Logf("Before getSmbGlobalMapping")
6883
err = getSmbGlobalMapping(remotePath)
6984
assert.NotNil(t, err)
85+
t.Logf("After getSmbGlobalMapping")
86+
t.Logf("Before writeReadFile")
7087
err = writeReadFile(localPath)
7188
assert.NotNil(t, err)
89+
t.Logf("After writeReadFile")
7290

7391
}

0 commit comments

Comments
 (0)