mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
test: add SpringBoot3 Tomcat test cases
This commit is contained in:
+2
@@ -9,6 +9,7 @@ import com.reajason.javaweb.memshell.packer.jar.JarPacker;
|
|||||||
import com.reajason.javaweb.suo5.Suo5Manager;
|
import com.reajason.javaweb.suo5.Suo5Manager;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.bytebuddy.jar.asm.Opcodes;
|
||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
@@ -230,6 +231,7 @@ public class ShellAssertionTool {
|
|||||||
.shellTool(shellTool)
|
.shellTool(shellTool)
|
||||||
.shellType(shellType)
|
.shellType(shellType)
|
||||||
.targetJreVersion(targetJdkVersion)
|
.targetJreVersion(targetJdkVersion)
|
||||||
|
.byPassJavaModule(targetJdkVersion >= Opcodes.V9)
|
||||||
.debug(true)
|
.debug(true)
|
||||||
.shrink(true)
|
.shrink(true)
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
+18
@@ -80,4 +80,22 @@ public class SpringBoot3ContainerTest {
|
|||||||
log.info("container started, app url is : {}", url);
|
log.info("container started, app url is : {}", url);
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Stream<Arguments> tomcatCasesProvider() {
|
||||||
|
Server server = Server.Tomcat;
|
||||||
|
List<String> supportedShellTypes = List.of(
|
||||||
|
ShellType.JAKARTA_FILTER,
|
||||||
|
// ShellType.LISTENER,
|
||||||
|
ShellType.JAKARTA_VALVE,
|
||||||
|
ShellType.JAKARTA_WEBSOCKET
|
||||||
|
);
|
||||||
|
List<Packers> testPackers = List.of(Packers.Base64);
|
||||||
|
return TestCasesProvider.getTestCases(imageName, server, supportedShellTypes, testPackers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
|
||||||
|
@MethodSource("tomcatCasesProvider")
|
||||||
|
void testTomcat(String imageName, String shellType, ShellTool shellTool, Packers packer) {
|
||||||
|
testShellInjectAssertOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V17, packer, container, python);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user