New domain options and properties for Debian Bookworm #1

Closed
hsh-timotheuspokorra wants to merge 41 commits from TP-202311-vhost-bookworm into rel_4.0
Showing only changes of commit 9a6a6d094a - Show all commits

View File

@ -135,6 +135,13 @@ public class DomainTest {
Map<?, ?> row = (Map<?, ?>) o; Map<?, ?> row = (Map<?, ?>) o;
assertTrue("Domain name should be exampleupdate.de but is " + row.get("name"), "exampleupdate.de".equals(row.get("name"))); assertTrue("Domain name should be exampleupdate.de but is " + row.get("name"), "exampleupdate.de".equals(row.get("name")));
assertTrue("ValidSubdomainNames should be * but is " + row.get("validsubdomainnames"), "*".equals(row.get("validsubdomainnames"))); assertTrue("ValidSubdomainNames should be * but is " + row.get("validsubdomainnames"), "*".equals(row.get("validsubdomainnames")));
String defaultPassengerPython = "";
assertTrue("PassengerPython should be empty but is " + row.get("passengerpython"), isNullOrEmpty(row.get("passengerpython")));
assertTrue("PassengerNodejs should be empty but is " + row.get("passengernodejs"), isNullOrEmpty(row.get("passengernodejs")));
assertTrue("PassengerRuby should be empty but is " + row.get("passengerruby"), isNullOrEmpty(row.get("passengerruby")));
assertTrue("FcgiPhpBin should be empty but is " + row.get("fcgiphpbin"), isNullOrEmpty(row.get("fcgiphpbin")));
String[] checkDomainOptions = Arrays.asList((Object[]) row.get("domainoptions")).toArray(new String[0]); String[] checkDomainOptions = Arrays.asList((Object[]) row.get("domainoptions")).toArray(new String[0]);
String[] expectedDomainOptions = new String[] {"htdocsfallback", "indexes", "dkim", "autoconfig", "greylisting", "includes", "letsencrypt", "multiviews"}; String[] expectedDomainOptions = new String[] {"htdocsfallback", "indexes", "dkim", "autoconfig", "greylisting", "includes", "letsencrypt", "multiviews"};
Arrays.sort(expectedDomainOptions); Arrays.sort(expectedDomainOptions);
@ -156,10 +163,21 @@ public class DomainTest {
// now update the domain // now update the domain
setParams = new HashMap<String, Object>(); setParams = new HashMap<String, Object>();
whereParams = new HashMap<String, String>();
setParams.put("validsubdomainnames", "www2"); setParams.put("validsubdomainnames", "www2");
String newPassengerPython = "/home/pacs/aaa00/users/admin/.venv/bin/python3";
setParams.put("passengerpython", newPassengerPython);
String newPassengerRuby = "/home/pacs/aaa00/users/admin/.rbenv/shims/ruby";
setParams.put("passengerruby", newPassengerRuby);
String newPassengerNodejs = "/home/pacs/aaa00/users/admin/.nvm/versions/node/v18.19.0/bin/node";
setParams.put("passengernodejs", newPassengerNodejs);
String newFcgiPhpBin = "/usr/bin/php8.1";
setParams.put("fcgiphpbin", newFcgiPhpBin);
String[] newDomainOptions = new String[] {"greylisting", "letsencrypt", "passenger", "passengerfriendlyerrorpages", "cgi", "fastcgi"}; String[] newDomainOptions = new String[] {"greylisting", "letsencrypt", "passenger", "passengerfriendlyerrorpages", "cgi", "fastcgi"};
setParams.put("domainoptions", newDomainOptions); setParams.put("domainoptions", newDomainOptions);
whereParams = new HashMap<String, String>();
whereParams.put("name", "exampleupdate.de"); whereParams.put("name", "exampleupdate.de");
params = new Object[] { user, params = new Object[] { user,
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
@ -174,6 +192,12 @@ public class DomainTest {
Map<?, ?> row = (Map<?, ?>) o; Map<?, ?> row = (Map<?, ?>) o;
assertTrue("Domain name should be exampleupdate.de but is " + row.get("name"), "exampleupdate.de".equals(row.get("name"))); assertTrue("Domain name should be exampleupdate.de but is " + row.get("name"), "exampleupdate.de".equals(row.get("name")));
assertTrue("ValidSubdomainNames should be www2 but is " + row.get("validsubdomainnames"), "www2".equals(row.get("validsubdomainnames"))); assertTrue("ValidSubdomainNames should be www2 but is " + row.get("validsubdomainnames"), "www2".equals(row.get("validsubdomainnames")));
assertTrue("PassengerPython should be " + newPassengerPython + " but is " + row.get("passengerpython"), newPassengerPython.equals(row.get("passengerpython")));
assertTrue("PassengerNodejs should be " + newPassengerNodejs + " but is " + row.get("passengernodejs"), newPassengerNodejs.equals(row.get("passengernodejs")));
assertTrue("PassengerRuby should be " + newPassengerRuby + " but is " + row.get("passengerruby"), newPassengerRuby.equals(row.get("passengerruby")));
assertTrue("FcgiPhpBin should be " + newFcgiPhpBin + " but is " + row.get("fcgiphpbin"), newFcgiPhpBin.equals(row.get("fcgiphpbin")));
String[] checkDomainOptions = Arrays.asList((Object[]) row.get("domainoptions")).toArray(new String[0]); String[] checkDomainOptions = Arrays.asList((Object[]) row.get("domainoptions")).toArray(new String[0]);
Arrays.sort(newDomainOptions); Arrays.sort(newDomainOptions);
Arrays.sort(checkDomainOptions); Arrays.sort(checkDomainOptions);
@ -193,6 +217,12 @@ public class DomainTest {
} }
} }
private Boolean isNullOrEmpty(Object s) {
if (s == null) return true;
if (((String)s).equals("")) return true;
return false;
}
@Test @Test
public void testCreateForeignSubdomain() throws UnknownHostException, IOException { public void testCreateForeignSubdomain() throws UnknownHostException, IOException {
int count = getDomsCount(); int count = getDomsCount();