mirror of
https://github.com/google/nomulus.git
synced 2025-05-28 13:51:15 +02:00
Make RdeUploadActionTest compatible with IPv6-only mode
This fixes an issue where RdeUploadActionTest relies on connecting to a local dummy SFTP server via the IPv4 loopback (127.0.0.1), which causes the test to fail on machines that only support IPv6. This updates the test to use just "localhost" instead. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148698178
This commit is contained in:
parent
c7a62e9b98
commit
93b5cfb71b
1 changed files with 6 additions and 6 deletions
|
@ -254,7 +254,7 @@ public class RdeUploadActionTest {
|
|||
@Test
|
||||
public void testSocketConnection() throws Exception {
|
||||
int port = sftpd.serve("user", "password", folder.getRoot());
|
||||
try (Socket socket = new Socket("::1", port)) {
|
||||
try (Socket socket = new Socket("localhost", port)) {
|
||||
assertThat(socket.isConnected()).isTrue();
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public class RdeUploadActionTest {
|
|||
// XXX: For any port other than 22, JSch will reformat the hostname IPv6 style which causes
|
||||
// known host matching to fail.
|
||||
int port = sftpd.serve("user", "password", folder.getRoot());
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@127.0.0.1:%d/", port));
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(
|
||||
|
@ -299,7 +299,7 @@ public class RdeUploadActionTest {
|
|||
@Test
|
||||
public void testRunWithLock_failsAfterThreeAttempts() throws Exception {
|
||||
int port = sftpd.serve("user", "password", folder.getRoot());
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@127.0.0.1:%d/", port));
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(
|
||||
|
@ -313,7 +313,7 @@ public class RdeUploadActionTest {
|
|||
@Test
|
||||
public void testRunWithLock_copiesOnGcs() throws Exception {
|
||||
int port = sftpd.serve("user", "password", folder.getRoot());
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@127.0.0.1:%d/", port));
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(
|
||||
|
@ -341,7 +341,7 @@ public class RdeUploadActionTest {
|
|||
RdeRevision.saveRevision("tld", DateTime.parse("2010-10-17TZ"), FULL, 1);
|
||||
}});
|
||||
int port = sftpd.serve("user", "password", folder.getRoot());
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@127.0.0.1:%d/", port));
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistSimpleResource(
|
||||
|
@ -361,7 +361,7 @@ public class RdeUploadActionTest {
|
|||
public void testRunWithLock_producesValidSignature() throws Exception {
|
||||
assumeTrue(hasCommand("gpg --version"));
|
||||
int port = sftpd.serve("user", "password", folder.getRoot());
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@127.0.0.1:%d/", port));
|
||||
URI uploadUrl = URI.create(String.format("sftp://user:password@localhost:%d/", port));
|
||||
DateTime stagingCursor = DateTime.parse("2010-10-18TZ");
|
||||
DateTime uploadCursor = DateTime.parse("2010-10-17TZ");
|
||||
persistResource(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue