File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
integration-tests/src/test/java/oracle/weblogic/kubernetes Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 50
50
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getUniqueName ;
51
51
import static oracle .weblogic .kubernetes .utils .ImageUtils .createBaseRepoSecret ;
52
52
import static oracle .weblogic .kubernetes .utils .ImageUtils .createTestRepoSecret ;
53
+ import static oracle .weblogic .kubernetes .utils .SampleUtils .createPVHostPathAndChangePermissionInKindCluster ;
53
54
import static oracle .weblogic .kubernetes .utils .ThreadSafeLogger .getLogger ;
54
55
import static org .junit .jupiter .api .Assertions .assertNotNull ;
55
56
import static org .junit .jupiter .api .Assertions .assertTrue ;
@@ -232,6 +233,7 @@ public void testInitialMain() {
232
233
if (KIND_REPO != null ) {
233
234
logger .info ("loading image {0} to kind" , FMWINFRA_IMAGE_TO_USE_IN_SPEC );
234
235
imagePush (FMWINFRA_IMAGE_TO_USE_IN_SPEC );
236
+ createPVHostPathAndChangePermissionInKindCluster ("/shared" , envMap );
235
237
}
236
238
237
239
execTestScriptAndAssertSuccess ("-initial-main" , "Failed to run -initial-main" );
Original file line number Diff line number Diff line change 48
48
import static oracle .weblogic .kubernetes .utils .CommonTestUtils .getUniqueName ;
49
49
import static oracle .weblogic .kubernetes .utils .ImageUtils .createBaseRepoSecret ;
50
50
import static oracle .weblogic .kubernetes .utils .ImageUtils .createTestRepoSecret ;
51
+ import static oracle .weblogic .kubernetes .utils .SampleUtils .createPVHostPathAndChangePermissionInKindCluster ;
51
52
import static oracle .weblogic .kubernetes .utils .ThreadSafeLogger .getLogger ;
52
53
import static org .junit .jupiter .api .Assertions .assertNotNull ;
53
54
import static org .junit .jupiter .api .Assertions .assertTrue ;
@@ -191,6 +192,7 @@ public void testInitialMain() {
191
192
if (KIND_REPO != null ) {
192
193
logger .info ("loading image {0} to kind" , WEBLOGIC_IMAGE_TO_USE_IN_SPEC );
193
194
imagePush (WEBLOGIC_IMAGE_TO_USE_IN_SPEC );
195
+ createPVHostPathAndChangePermissionInKindCluster ("/shared" , envMap );
194
196
}
195
197
196
198
execTestScriptAndAssertSuccess ("-initial-main" , "Failed to run -initial-main" );
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2023, Oracle and/or its affiliates.
2
+ // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3
+
4
+ package oracle .weblogic .kubernetes .utils ;
5
+
6
+ import java .util .Map ;
7
+
8
+ import oracle .weblogic .kubernetes .actions .impl .primitive .Command ;
9
+ import oracle .weblogic .kubernetes .actions .impl .primitive .CommandParams ;
10
+
11
+ import static oracle .weblogic .kubernetes .TestConstants .WLSIMG_BUILDER_DEFAULT ;
12
+
13
+ /**
14
+ * The Sample utility class for tests.
15
+ */
16
+ public class SampleUtils {
17
+
18
+ /**
19
+ * Create PV hostPath and change permission in Kind cluster.
20
+ * @param hostPath - hostPath for PV
21
+ * @param envMap - envMap for running the docker command
22
+ */
23
+ public static void createPVHostPathAndChangePermissionInKindCluster (String hostPath , Map <String , String > envMap ) {
24
+ String command = WLSIMG_BUILDER_DEFAULT
25
+ + " exec kind-worker sh -c \" mkdir "
26
+ + hostPath
27
+ + " && chmod g+w "
28
+ + hostPath
29
+ + "\" " ;
30
+
31
+ Command .withParams (
32
+ new CommandParams ()
33
+ .command (command )
34
+ .env (envMap )
35
+ .redirect (true )
36
+ ).execute ();
37
+ }
38
+ }
You can’t perform that action at this time.
0 commit comments