Fixes #11583 - Broken HTTP/3 tests (#11584)

Initialized PEM directories for both client and server.
Added [lib] section that was missing due to #11263.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2024-03-27 22:37:33 +01:00 committed by GitHub
parent ee82c2b761
commit e00a71a00f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 4 deletions

View File

@ -5,6 +5,9 @@ https://github.com/java-native-access/jna
[files]
maven://net.java.dev.jna/jna-jpms/${jna.version}|lib/http3/jna-jpms-${jna.version}.jar
[lib]
lib/http3/jna-jpms-${jna.version}.jar
[ini]
jna.version?=@jna.version@

View File

@ -8,6 +8,9 @@ maven://org.mortbay.jetty.quiche/jetty-quiche-native/${jetty-quiche-native.versi
[ini]
jetty-quiche-native.version?=@jetty-quiche-native.version@
[lib]
lib/http3/jetty-quiche-native-${jetty-quiche-native.version}.jar
[license]
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -63,6 +63,7 @@ import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;
@ExtendWith(WorkDirExtension.class)
@ -71,6 +72,7 @@ public class AbstractTest
public WorkDir workDir;
protected final HttpConfiguration httpConfig = new HttpConfiguration();
protected Path pemDir;
protected SslContextFactory.Server sslContextFactoryServer;
protected ServerQuicConfiguration serverQuicConfig;
protected Server server;
@ -100,6 +102,12 @@ public class AbstractTest
return transports;
}
@BeforeEach
public void prepare()
{
pemDir = workDir.getEmptyPathDir();
}
@AfterEach
public void dispose()
{
@ -122,7 +130,8 @@ public class AbstractTest
protected void prepareServer(Transport transport, HttpServlet servlet) throws Exception
{
sslContextFactoryServer = newSslContextFactoryServer();
serverQuicConfig = new ServerQuicConfiguration(sslContextFactoryServer, workDir.getEmptyPathDir());
Path serverPemDirectory = Files.createDirectories(pemDir.resolve("server"));
serverQuicConfig = new ServerQuicConfiguration(sslContextFactoryServer, serverPemDirectory);
if (server == null)
server = newServer();
connector = newConnector(transport, server);
@ -262,7 +271,8 @@ public class AbstractTest
clientConnector.setSelectors(1);
SslContextFactory.Client sslContextFactory = newSslContextFactoryClient();
clientConnector.setSslContextFactory(sslContextFactory);
HTTP3Client http3Client = new HTTP3Client(new ClientQuicConfiguration(sslContextFactory, null));
Path clientPemDirectory = Files.createDirectories(pemDir.resolve("client"));
HTTP3Client http3Client = new HTTP3Client(new ClientQuicConfiguration(sslContextFactory, clientPemDirectory));
yield new HttpClientTransportOverHTTP3(http3Client);
}
case FCGI -> new HttpClientTransportOverFCGI(1, "");

View File

@ -67,6 +67,7 @@ import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;
@ExtendWith(WorkDirExtension.class)
@ -75,6 +76,7 @@ public class AbstractTest
public WorkDir workDir;
protected final HttpConfiguration httpConfig = new HttpConfiguration();
protected Path pemDir;
protected SslContextFactory.Server sslContextFactoryServer;
protected ServerQuicConfiguration serverQuicConfig;
protected Server server;
@ -104,6 +106,12 @@ public class AbstractTest
return transports;
}
@BeforeEach
public void prepare()
{
pemDir = workDir.getEmptyPathDir();
}
@AfterEach
public void dispose()
{
@ -131,7 +139,8 @@ public class AbstractTest
protected void prepareServer(Transport transport, HttpServlet servlet, String path) throws Exception
{
sslContextFactoryServer = newSslContextFactoryServer();
serverQuicConfig = new ServerQuicConfiguration(sslContextFactoryServer, workDir.getEmptyPathDir());
Path serverPemDirectory = Files.createDirectories(pemDir.resolve("server"));
serverQuicConfig = new ServerQuicConfiguration(sslContextFactoryServer, serverPemDirectory);
if (server == null)
server = newServer();
connector = newConnector(transport, server);
@ -268,7 +277,8 @@ public class AbstractTest
clientConnector.setSelectors(1);
SslContextFactory.Client sslContextFactory = newSslContextFactoryClient();
clientConnector.setSslContextFactory(sslContextFactory);
HTTP3Client http3Client = new HTTP3Client(new ClientQuicConfiguration(sslContextFactory, null));
Path clientPemDirectory = Files.createDirectories(pemDir.resolve("client"));
HTTP3Client http3Client = new HTTP3Client(new ClientQuicConfiguration(sslContextFactory, clientPemDirectory));
yield new HttpClientTransportOverHTTP3(http3Client);
}
case FCGI -> new HttpClientTransportOverFCGI(1, "");