nextcloud: test for all supported versions

This commit is contained in:
ibizaman 2026-01-07 22:49:13 +01:00 committed by Pierre Penninckx
parent 78b5e59830
commit a584decd52
2 changed files with 284 additions and 199 deletions

View file

@ -1022,6 +1022,7 @@ in
${occ} app:enable user_ldap ${occ} app:enable user_ldap
${occ} config:app:set user_ldap ${cID}ldap_configuration_active --value=0 ${occ} config:app:set user_ldap ${cID}ldap_configuration_active --value=0
${occ} config:app:set user_ldap configuration_prefixes --value '["${cID}"]'
# The following CLI commands follow # The following CLI commands follow
# https://github.com/lldap/lldap/blob/main/example_configs/nextcloud.md#nextcloud-config--the-cli-way # https://github.com/lldap/lldap/blob/main/example_configs/nextcloud.md#nextcloud-config--the-cli-way

View file

@ -1,5 +1,10 @@
{ lib, shb, ... }: { lib, shb, ... }:
let let
supportedVersion = [
31
32
];
adminUser = "root"; adminUser = "root";
adminPass = "rootpw"; adminPass = "rootpw";
oidcSecret = "oidcSecret"; oidcSecret = "oidcSecret";
@ -149,7 +154,7 @@ let
startUrl = "http://${config.test.fqdn}"; startUrl = "http://${config.test.fqdn}";
usernameFieldLabelRegex = "Account name"; usernameFieldLabelRegex = "Account name";
passwordFieldLabelRegex = "^ *[Pp]assword"; passwordFieldLabelRegex = "^ *[Pp]assword";
loginButtonNameRegex = "[Ll]og [Ii]n"; loginButtonNameRegex = "^[Ll]og [Ii]n$";
testLoginWith = [ testLoginWith = [
{ {
username = adminUser; username = adminUser;
@ -189,7 +194,7 @@ let
startUrl = "http://${config.test.fqdn}"; startUrl = "http://${config.test.fqdn}";
usernameFieldLabelRegex = "Account name"; usernameFieldLabelRegex = "Account name";
passwordFieldLabelRegex = "^ *[Pp]assword"; passwordFieldLabelRegex = "^ *[Pp]assword";
loginButtonNameRegex = "[Ll]og [Ii]n"; loginButtonNameRegex = "^[Ll]og [Ii]n$";
testLoginWith = [ testLoginWith = [
{ {
username = "alice"; username = "alice";
@ -442,10 +447,11 @@ let
) )
print(response) print(response)
''; '';
in
{ basicTest =
basic = shb.test.runNixOSTest { version:
name = "nextcloud_basic"; shb.test.runNixOSTest {
name = "nextcloud_basic_${toString version}";
nodes.client = { nodes.client = {
imports = [ imports = [
@ -455,18 +461,26 @@ in
nodes.server = { nodes.server = {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
]; ];
}; };
testScript = commonTestScript.access; testScript = commonTestScript.access;
}; };
cron = shb.test.runNixOSTest { cronTest =
name = "nextcloud_cron"; version:
shb.test.runNixOSTest {
name = "nextcloud_cron_${toString version}";
nodes.server = { nodes.server = {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
]; ];
}; };
@ -504,14 +518,19 @@ in
}; };
}; };
backup = shb.test.runNixOSTest { backupTest =
name = "nextcloud_backup"; version:
shb.test.runNixOSTest {
name = "nextcloud_backup_${toString version}";
nodes.server = nodes.server =
{ config, ... }: { config, ... }:
{ {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
(shb.test.backup config.shb.nextcloud.backup) (shb.test.backup config.shb.nextcloud.backup)
]; ];
}; };
@ -521,12 +540,17 @@ in
testScript = commonTestScript.backup; testScript = commonTestScript.backup;
}; };
https = shb.test.runNixOSTest { httpsTest =
name = "nextcloud_https"; version:
shb.test.runNixOSTest {
name = "nextcloud_https_${toString version}";
nodes.server = { nodes.server = {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
shb.test.certs shb.test.certs
https https
]; ];
@ -538,12 +562,17 @@ in
testScript = commonTestScript.access; testScript = commonTestScript.access;
}; };
previewGenerator = shb.test.runNixOSTest { previewGeneratorTest =
name = "nextcloud_previewGenerator"; version:
shb.test.runNixOSTest {
name = "nextcloud_previewGenerator_${toString version}";
nodes.server = { nodes.server = {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
shb.test.certs shb.test.certs
https https
previewgenerator previewgenerator
@ -555,12 +584,17 @@ in
testScript = commonTestScript.access; testScript = commonTestScript.access;
}; };
externalStorage = shb.test.runNixOSTest { externalStorageTest =
name = "nextcloud_externalStorage"; version:
shb.test.runNixOSTest {
name = "nextcloud_externalStorage_${toString version}";
nodes.server = { nodes.server = {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
shb.test.certs shb.test.certs
https https
externalstorage externalstorage
@ -575,29 +609,39 @@ in
# TODO: fix memories app # TODO: fix memories app
# See https://github.com/ibizaman/selfhostblocks/issues/476 # See https://github.com/ibizaman/selfhostblocks/issues/476
# memories = shb.test.runNixOSTest { memoriesTest =
# name = "nextcloud_memories"; version:
shb.test.runNixOSTest {
# nodes.server = { name = "nextcloud_memories_${toString version}";
# imports = [
# basic
# shb.test.certs
# https
# memories
# ];
# };
# nodes.client = {};
# testScript = commonTestScript.access;
# };
recognize = shb.test.runNixOSTest {
name = "nextcloud_recognize";
nodes.server = { nodes.server = {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
shb.test.certs
https
memories
];
};
nodes.client = { };
testScript = commonTestScript.access;
};
recognizeTest =
version:
shb.test.runNixOSTest {
name = "nextcloud_recognize_${toString version}";
nodes.server = {
imports = [
basic
{
shb.nextcloud.version = version;
}
shb.test.certs shb.test.certs
https https
recognize recognize
@ -609,14 +653,19 @@ in
testScript = commonTestScript.access; testScript = commonTestScript.access;
}; };
ldap = shb.test.runNixOSTest { ldapTest =
name = "nextcloud_ldap"; version:
shb.test.runNixOSTest {
name = "nextcloud_ldap_${toString version}";
nodes.server = nodes.server =
{ config, ... }: { config, ... }:
{ {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
shb.test.certs shb.test.certs
https https
shb.test.ldap shb.test.ldap
@ -633,14 +682,19 @@ in
testScript = commonTestScript.access; testScript = commonTestScript.access;
}; };
sso = shb.test.runNixOSTest { ssoTest =
name = "nextcloud_sso"; version:
shb.test.runNixOSTest {
name = "nextcloud_sso_${toString version}";
nodes.server = nodes.server =
{ config, ... }: { config, ... }:
{ {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
shb.test.certs shb.test.certs
https https
shb.test.ldap shb.test.ldap
@ -674,14 +728,19 @@ in
testScript = commonTestScript.access; testScript = commonTestScript.access;
}; };
prometheus = shb.test.runNixOSTest { prometheusTest =
name = "nextcloud_prometheus"; version:
shb.test.runNixOSTest {
name = "nextcloud_prometheus_${toString version}";
nodes.server = nodes.server =
{ config, ... }: { config, ... }:
{ {
imports = [ imports = [
basic basic
{
shb.nextcloud.version = version;
}
prometheus prometheus
]; ];
}; };
@ -690,4 +749,29 @@ in
testScript = prometheusTestScript; testScript = prometheusTestScript;
}; };
}
versionedTests = v: {
"basic_${toString v}" = basicTest v;
"cron_${toString v}" = cronTest v;
"backup_${toString v}" = backupTest v;
"https_${toString v}" = httpsTest v;
"previewGenerator_${toString v}" = previewGeneratorTest v;
"externalStorage_${toString v}" = externalStorageTest v;
"memories_${toString v}" = memoriesTest v;
"recognize_${toString v}" = recognizeTest v;
"ldap_${toString v}" = ldapTest v;
"sso_${toString v}" = ssoTest v;
"prometheus_${toString v}" = prometheusTest v;
};
in
lib.foldl (all: v: lib.mergeAttrs all (versionedTests v)) { } supportedVersion