Allow HTTP {listen,canonicalWeb}Url in tests
Enable the ability to test the Gerrit HTTP behaviour with
different listenUrl and canonicalWebUrl configurations.
E.g. Using canonicalWebUrl <> httpd.listenUrl for reverse-proxy
     scenarios.
Change-Id: Ie0bc508dbe1d979f1235143134fbe6526c7f4848
			
			
This commit is contained in:
		| @@ -406,6 +406,9 @@ public abstract class AbstractDaemonTest { | |||||||
|       baseConfig.setString("sshd", null, "listenAddress", "off"); |       baseConfig.setString("sshd", null, "listenAddress", "off"); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     baseConfig.unset("gerrit", null, "canonicalWebUrl"); | ||||||
|  |     baseConfig.unset("httpd", null, "listenUrl"); | ||||||
|  |  | ||||||
|     baseConfig.setInt("index", null, "batchThreads", -1); |     baseConfig.setInt("index", null, "batchThreads", -1); | ||||||
|  |  | ||||||
|     baseConfig.setInt("receive", null, "changeUpdateThreads", 4); |     baseConfig.setInt("receive", null, "changeUpdateThreads", 4); | ||||||
|   | |||||||
| @@ -463,9 +463,13 @@ public class GerritServer implements AutoCloseable { | |||||||
|   private static void mergeTestConfig(Config cfg) { |   private static void mergeTestConfig(Config cfg) { | ||||||
|     String forceEphemeralPort = String.format("%s:0", getLocalHost().getHostName()); |     String forceEphemeralPort = String.format("%s:0", getLocalHost().getHostName()); | ||||||
|     String url = "http://" + forceEphemeralPort + "/"; |     String url = "http://" + forceEphemeralPort + "/"; | ||||||
|     cfg.setString("gerrit", null, "canonicalWebUrl", url); |  | ||||||
|     cfg.setString("httpd", null, "listenUrl", url); |  | ||||||
|  |  | ||||||
|  |     if (cfg.getString("gerrit", null, "canonicalWebUrl") == null) { | ||||||
|  |       cfg.setString("gerrit", null, "canonicalWebUrl", url); | ||||||
|  |     } | ||||||
|  |     if (cfg.getString("httpd", null, "listenUrl") == null) { | ||||||
|  |       cfg.setString("httpd", null, "listenUrl", url); | ||||||
|  |     } | ||||||
|     if (cfg.getString("sshd", null, "listenAddress") == null) { |     if (cfg.getString("sshd", null, "listenAddress") == null) { | ||||||
|       cfg.setString("sshd", null, "listenAddress", forceEphemeralPort); |       cfg.setString("sshd", null, "listenAddress", forceEphemeralPort); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Luca Milanesio
					Luca Milanesio