mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-23 23:41:52 +08:00
feat: support Neo-reGeorg shell generate (#35)
This commit is contained in:
+10
-1
@@ -12,7 +12,9 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
@@ -32,11 +34,18 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
@Testcontainers
|
||||
public class Tomcat10ContainerTest {
|
||||
public static final String imageName = "tomcat:10.1-jre11";
|
||||
static Network network = Network.newNetwork();
|
||||
@Container
|
||||
public final static GenericContainer<?> python = new GenericContainer<>(new ImageFromDockerfile()
|
||||
.withDockerfile(neoGeorgDockerfile))
|
||||
.withNetwork(network);
|
||||
@Container
|
||||
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
|
||||
.withCopyToContainer(warJakartaFile, "/usr/local/tomcat/webapps/app.war")
|
||||
.withCopyToContainer(jattachFile, "/jattach")
|
||||
.withCopyToContainer(tomcatPid, "/fetch_pid.sh")
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases("app")
|
||||
.waitingFor(Wait.forHttp("/app"))
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@@ -58,6 +67,6 @@ public class Tomcat10ContainerTest {
|
||||
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||
@MethodSource("casesProvider")
|
||||
void test(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V11, packer, container);
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V11, packer, container, python);
|
||||
}
|
||||
}
|
||||
|
||||
+10
-1
@@ -12,7 +12,9 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
@@ -33,11 +35,18 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
public class Tomcat11ContainerTest {
|
||||
|
||||
public static final String imageName = "tomcat:11.0-jre17";
|
||||
static Network network = Network.newNetwork();
|
||||
@Container
|
||||
public final static GenericContainer<?> python = new GenericContainer<>(new ImageFromDockerfile()
|
||||
.withDockerfile(neoGeorgDockerfile))
|
||||
.withNetwork(network);
|
||||
@Container
|
||||
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
|
||||
.withCopyToContainer(warJakartaFile, "/usr/local/tomcat/webapps/app.war")
|
||||
.withCopyToContainer(jattachFile, "/jattach")
|
||||
.withCopyToContainer(tomcatPid, "/fetch_pid.sh")
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases("app")
|
||||
.waitingFor(Wait.forHttp("/app"))
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@@ -59,6 +68,6 @@ public class Tomcat11ContainerTest {
|
||||
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||
@MethodSource("casesProvider")
|
||||
void test(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V17, packer, container);
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V17, packer, container, python);
|
||||
}
|
||||
}
|
||||
|
||||
+11
-1
@@ -12,7 +12,9 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
@@ -33,11 +35,19 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
public class Tomcat11JRE21ContainerTest {
|
||||
|
||||
public static final String imageName = "tomcat:11.0-jre21";
|
||||
static Network network = Network.newNetwork();
|
||||
@Container
|
||||
public final static GenericContainer<?> python = new GenericContainer<>(new ImageFromDockerfile()
|
||||
.withDockerfile(neoGeorgDockerfile))
|
||||
.withNetwork(network);
|
||||
|
||||
@Container
|
||||
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
|
||||
.withCopyToContainer(warJakartaFile, "/usr/local/tomcat/webapps/app.war")
|
||||
.withCopyToContainer(jattachFile, "/jattach")
|
||||
.withCopyToContainer(tomcatPid, "/fetch_pid.sh")
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases("app")
|
||||
.waitingFor(Wait.forHttp("/app"))
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@@ -59,6 +69,6 @@ public class Tomcat11JRE21ContainerTest {
|
||||
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||
@MethodSource("casesProvider")
|
||||
void test(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V21, packer, container);
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V21, packer, container, python);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-1
@@ -12,7 +12,9 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
@@ -32,11 +34,20 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
@Testcontainers
|
||||
public class Tomcat5ContainerTest {
|
||||
public static final String imageName = "reajason/tomcat:5-jdk6";
|
||||
|
||||
static Network network = Network.newNetwork();
|
||||
@Container
|
||||
public final static GenericContainer<?> python = new GenericContainer<>(new ImageFromDockerfile()
|
||||
.withDockerfile(neoGeorgDockerfile))
|
||||
.withNetwork(network);
|
||||
|
||||
@Container
|
||||
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
|
||||
.withCopyToContainer(warFile, "/usr/local/tomcat/webapps/app.war")
|
||||
.withCopyToContainer(jattachFile, "/jattach")
|
||||
.withCopyToContainer(tomcatPid, "/fetch_pid.sh")
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases("app")
|
||||
.waitingFor(Wait.forHttp("/app"))
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@@ -57,6 +68,6 @@ public class Tomcat5ContainerTest {
|
||||
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||
@MethodSource("casesProvider")
|
||||
void test(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_6, packer, container);
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_6, packer, container, python);
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -12,7 +12,9 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
@@ -32,11 +34,18 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
@Testcontainers
|
||||
public class Tomcat6ContainerTest {
|
||||
public static final String imageName = "reajason/tomcat:6-jdk6";
|
||||
static Network network = Network.newNetwork();
|
||||
@Container
|
||||
public final static GenericContainer<?> python = new GenericContainer<>(new ImageFromDockerfile()
|
||||
.withDockerfile(neoGeorgDockerfile))
|
||||
.withNetwork(network);
|
||||
@Container
|
||||
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
|
||||
.withCopyToContainer(warFile, "/usr/local/tomcat/webapps/app.war")
|
||||
.withCopyToContainer(jattachFile, "/jattach")
|
||||
.withCopyToContainer(tomcatPid, "/fetch_pid.sh")
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases("app")
|
||||
.waitingFor(Wait.forHttp("/app"))
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@@ -58,6 +67,6 @@ public class Tomcat6ContainerTest {
|
||||
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||
@MethodSource("casesProvider")
|
||||
void test(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_6, packer, container);
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_6, packer, container, python);
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -12,7 +12,9 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
@@ -32,11 +34,18 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
@Testcontainers
|
||||
public class Tomcat7ContainerTest {
|
||||
public static final String imageName = "tomcat:7.0.85-jre7";
|
||||
static Network network = Network.newNetwork();
|
||||
@Container
|
||||
public final static GenericContainer<?> python = new GenericContainer<>(new ImageFromDockerfile()
|
||||
.withDockerfile(neoGeorgDockerfile))
|
||||
.withNetwork(network);
|
||||
@Container
|
||||
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
|
||||
.withCopyToContainer(warFile, "/usr/local/tomcat/webapps/app.war")
|
||||
.withCopyToContainer(jattachFile, "/jattach")
|
||||
.withCopyToContainer(tomcatPid, "/fetch_pid.sh")
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases("app")
|
||||
.waitingFor(Wait.forHttp("/app"))
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@@ -57,6 +66,6 @@ public class Tomcat7ContainerTest {
|
||||
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||
@MethodSource("casesProvider")
|
||||
void test(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_7, packer, container);
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_7, packer, container, python);
|
||||
}
|
||||
}
|
||||
+11
-1
@@ -12,7 +12,9 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
@@ -33,11 +35,19 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
public class Tomcat8ContainerTest {
|
||||
public static final String imageName = "tomcat:8-jre8";
|
||||
|
||||
static Network network = Network.newNetwork();
|
||||
@Container
|
||||
public final static GenericContainer<?> python = new GenericContainer<>(new ImageFromDockerfile()
|
||||
.withDockerfile(neoGeorgDockerfile))
|
||||
.withNetwork(network);
|
||||
|
||||
@Container
|
||||
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
|
||||
.withCopyToContainer(warFile, "/usr/local/tomcat/webapps/app.war")
|
||||
.withCopyToContainer(jattachFile, "/jattach")
|
||||
.withCopyToContainer(tomcatPid, "/fetch_pid.sh")
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases("app")
|
||||
.waitingFor(Wait.forHttp("/app"))
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@@ -58,6 +68,6 @@ public class Tomcat8ContainerTest {
|
||||
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||
@MethodSource("casesProvider")
|
||||
void test(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_8, packer, container);
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_8, packer, container, python);
|
||||
}
|
||||
}
|
||||
+10
-1
@@ -12,7 +12,9 @@ import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.Network;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
@@ -32,11 +34,18 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||
@Testcontainers
|
||||
public class Tomcat9ContainerTest {
|
||||
public static final String imageName = "tomcat:9-jre9";
|
||||
static Network network = Network.newNetwork();
|
||||
@Container
|
||||
public final static GenericContainer<?> python = new GenericContainer<>(new ImageFromDockerfile()
|
||||
.withDockerfile(neoGeorgDockerfile))
|
||||
.withNetwork(network);
|
||||
@Container
|
||||
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
|
||||
.withCopyToContainer(warFile, "/usr/local/tomcat/webapps/app.war")
|
||||
.withCopyToContainer(jattachFile, "/jattach")
|
||||
.withCopyToContainer(tomcatPid, "/fetch_pid.sh")
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases("app")
|
||||
.waitingFor(Wait.forHttp("/app"))
|
||||
.withExposedPorts(8080);
|
||||
|
||||
@@ -58,6 +67,6 @@ public class Tomcat9ContainerTest {
|
||||
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||
@MethodSource("casesProvider")
|
||||
void test(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V9, packer, container);
|
||||
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V9, packer, container, python);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user