@@ -1503,6 +1503,35 @@ public void launchProxyWithAuthorizedAdditionalManifests() {
15031503 }
15041504 }
15051505
1506+ @ Test
1507+ public void launchProxyWithDns () {
1508+ try (ContainerSetup k8s = new ContainerSetup ("kubernetes" )) {
1509+ String id = inst .client .startProxy ("01_hello_dns" );
1510+ Proxy proxy = inst .proxyService .getProxy (id );
1511+
1512+ PodList podList = k8s .client .pods ().inNamespace (k8s .namespace ).list ();
1513+ Assertions .assertEquals (1 , podList .getItems ().size ());
1514+ Pod pod = podList .getItems ().get (0 );
1515+ Assertions .assertEquals ("Running" , pod .getStatus ().getPhase ());
1516+ Assertions .assertEquals (k8s .namespace , pod .getMetadata ().getNamespace ());
1517+ Assertions .assertEquals ("sp-pod-" + proxy .getId () + "-0" , pod .getMetadata ().getName ());
1518+ Assertions .assertEquals (1 , pod .getStatus ().getContainerStatuses ().size ());
1519+ ContainerStatus container = pod .getStatus ().getContainerStatuses ().get (0 );
1520+ Assertions .assertEquals (true , container .getReady ());
1521+ Assertions .assertTrue (container .getImage ().endsWith ("openanalytics/shinyproxy-integration-test-app:latest" ));
1522+ Assertions .assertFalse (pod .getSpec ().getContainers ().get (0 ).getSecurityContext ().getPrivileged ());
1523+ Assertions .assertEquals (List .of ("9.9.9.9" ), pod .getSpec ().getDnsConfig ().getNameservers ());
1524+
1525+ inst .proxyService .stopProxy (null , proxy , true ).run ();
1526+
1527+ // all pods should be deleted
1528+ assertNoPods (k8s );
1529+ // all services should be deleted
1530+ assertNoServices (k8s );
1531+ }
1532+ }
1533+
1534+
15061535 private void assertNoPods (ContainerSetup k8s ) {
15071536 boolean cleanedUp = Retrying .retry ((c , m ) -> {
15081537 List <Pod > pods1 = k8s .client .pods ().inNamespace (k8s .namespace ).list ().getItems ();
0 commit comments