@@ -13,21 +13,7 @@ import (
1313var lps = "local-path-storage"
1414
1515func TestLocalPathProvisionerStorage (cluster * shared.Cluster , applyWorkload , deleteWorkload bool ) {
16- nodeOS := os .Getenv ("node_os" )
17- if nodeOS == "slemicro" {
18- var output string
19- var mkdirErr error
20- for _ , ip := range cluster .ServerIPs {
21- output , mkdirErr = shared .RunCommandOnNode ("test -d '/opt/data' && echo 'directory exists: /opt/data' || sudo mkdir -p /opt/data; ls -lrt /opt" , ip )
22- if mkdirErr != nil {
23- shared .LogLevel ("warn" , "error creating /opt/data dir on node ip: %s" , ip )
24- }
25- if output != "" {
26- shared .LogLevel ("debug" , "create and check /opt/data output: %s" , output )
27- }
28- }
29-
30- }
16+ createDir (cluster )
3117 var workloadErr error
3218 if applyWorkload {
3319 workloadErr = shared .ManageWorkload ("apply" , "local-path-provisioner.yaml" )
@@ -89,3 +75,20 @@ func readData(cluster *shared.Cluster) error {
8975
9076 return nil
9177}
78+
79+ func createDir (cluster * shared.Cluster ) {
80+ nodeOS := os .Getenv ("node_os" )
81+ if nodeOS == "slemicro" {
82+ var output string
83+ var mkdirErr error
84+ for _ , ip := range cluster .ServerIPs {
85+ output , mkdirErr = shared .RunCommandOnNode ("test -d '/opt/data' && echo 'directory exists: /opt/data' || sudo mkdir -p /opt/data; ls -lrt /opt" , ip )
86+ if mkdirErr != nil {
87+ shared .LogLevel ("warn" , "error creating /opt/data dir on node ip: %s" , ip )
88+ }
89+ if output != "" {
90+ shared .LogLevel ("debug" , "create and check /opt/data output: %s" , output )
91+ }
92+ }
93+ }
94+ }
0 commit comments