nextcloud: test for all supported versions
This commit is contained in:
parent
78b5e59830
commit
a584decd52
2 changed files with 284 additions and 199 deletions
|
|
@ -1022,6 +1022,7 @@ in
|
|||
${occ} app:enable user_ldap
|
||||
|
||||
${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
|
||||
# https://github.com/lldap/lldap/blob/main/example_configs/nextcloud.md#nextcloud-config--the-cli-way
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{ lib, shb, ... }:
|
||||
let
|
||||
supportedVersion = [
|
||||
31
|
||||
32
|
||||
];
|
||||
|
||||
adminUser = "root";
|
||||
adminPass = "rootpw";
|
||||
oidcSecret = "oidcSecret";
|
||||
|
|
@ -149,7 +154,7 @@ let
|
|||
startUrl = "http://${config.test.fqdn}";
|
||||
usernameFieldLabelRegex = "Account name";
|
||||
passwordFieldLabelRegex = "^ *[Pp]assword";
|
||||
loginButtonNameRegex = "[Ll]og [Ii]n";
|
||||
loginButtonNameRegex = "^[Ll]og [Ii]n$";
|
||||
testLoginWith = [
|
||||
{
|
||||
username = adminUser;
|
||||
|
|
@ -189,7 +194,7 @@ let
|
|||
startUrl = "http://${config.test.fqdn}";
|
||||
usernameFieldLabelRegex = "Account name";
|
||||
passwordFieldLabelRegex = "^ *[Pp]assword";
|
||||
loginButtonNameRegex = "[Ll]og [Ii]n";
|
||||
loginButtonNameRegex = "^[Ll]og [Ii]n$";
|
||||
testLoginWith = [
|
||||
{
|
||||
username = "alice";
|
||||
|
|
@ -442,10 +447,11 @@ let
|
|||
)
|
||||
print(response)
|
||||
'';
|
||||
in
|
||||
{
|
||||
basic = shb.test.runNixOSTest {
|
||||
name = "nextcloud_basic";
|
||||
|
||||
basicTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_basic_${toString version}";
|
||||
|
||||
nodes.client = {
|
||||
imports = [
|
||||
|
|
@ -455,18 +461,26 @@ in
|
|||
nodes.server = {
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
testScript = commonTestScript.access;
|
||||
};
|
||||
|
||||
cron = shb.test.runNixOSTest {
|
||||
name = "nextcloud_cron";
|
||||
cronTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_cron_${toString version}";
|
||||
|
||||
nodes.server = {
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
|
@ -504,14 +518,19 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
backup = shb.test.runNixOSTest {
|
||||
name = "nextcloud_backup";
|
||||
backupTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_backup_${toString version}";
|
||||
|
||||
nodes.server =
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
(shb.test.backup config.shb.nextcloud.backup)
|
||||
];
|
||||
};
|
||||
|
|
@ -521,12 +540,17 @@ in
|
|||
testScript = commonTestScript.backup;
|
||||
};
|
||||
|
||||
https = shb.test.runNixOSTest {
|
||||
name = "nextcloud_https";
|
||||
httpsTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_https_${toString version}";
|
||||
|
||||
nodes.server = {
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
shb.test.certs
|
||||
https
|
||||
];
|
||||
|
|
@ -538,12 +562,17 @@ in
|
|||
testScript = commonTestScript.access;
|
||||
};
|
||||
|
||||
previewGenerator = shb.test.runNixOSTest {
|
||||
name = "nextcloud_previewGenerator";
|
||||
previewGeneratorTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_previewGenerator_${toString version}";
|
||||
|
||||
nodes.server = {
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
shb.test.certs
|
||||
https
|
||||
previewgenerator
|
||||
|
|
@ -555,12 +584,17 @@ in
|
|||
testScript = commonTestScript.access;
|
||||
};
|
||||
|
||||
externalStorage = shb.test.runNixOSTest {
|
||||
name = "nextcloud_externalStorage";
|
||||
externalStorageTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_externalStorage_${toString version}";
|
||||
|
||||
nodes.server = {
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
shb.test.certs
|
||||
https
|
||||
externalstorage
|
||||
|
|
@ -575,29 +609,39 @@ in
|
|||
# TODO: fix memories app
|
||||
# See https://github.com/ibizaman/selfhostblocks/issues/476
|
||||
|
||||
# memories = shb.test.runNixOSTest {
|
||||
# name = "nextcloud_memories";
|
||||
|
||||
# nodes.server = {
|
||||
# imports = [
|
||||
# basic
|
||||
# shb.test.certs
|
||||
# https
|
||||
# memories
|
||||
# ];
|
||||
# };
|
||||
|
||||
# nodes.client = {};
|
||||
|
||||
# testScript = commonTestScript.access;
|
||||
# };
|
||||
|
||||
recognize = shb.test.runNixOSTest {
|
||||
name = "nextcloud_recognize";
|
||||
memoriesTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_memories_${toString version}";
|
||||
|
||||
nodes.server = {
|
||||
imports = [
|
||||
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
|
||||
https
|
||||
recognize
|
||||
|
|
@ -609,14 +653,19 @@ in
|
|||
testScript = commonTestScript.access;
|
||||
};
|
||||
|
||||
ldap = shb.test.runNixOSTest {
|
||||
name = "nextcloud_ldap";
|
||||
ldapTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_ldap_${toString version}";
|
||||
|
||||
nodes.server =
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
shb.test.certs
|
||||
https
|
||||
shb.test.ldap
|
||||
|
|
@ -633,14 +682,19 @@ in
|
|||
testScript = commonTestScript.access;
|
||||
};
|
||||
|
||||
sso = shb.test.runNixOSTest {
|
||||
name = "nextcloud_sso";
|
||||
ssoTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_sso_${toString version}";
|
||||
|
||||
nodes.server =
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
shb.test.certs
|
||||
https
|
||||
shb.test.ldap
|
||||
|
|
@ -674,14 +728,19 @@ in
|
|||
testScript = commonTestScript.access;
|
||||
};
|
||||
|
||||
prometheus = shb.test.runNixOSTest {
|
||||
name = "nextcloud_prometheus";
|
||||
prometheusTest =
|
||||
version:
|
||||
shb.test.runNixOSTest {
|
||||
name = "nextcloud_prometheus_${toString version}";
|
||||
|
||||
nodes.server =
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
basic
|
||||
{
|
||||
shb.nextcloud.version = version;
|
||||
}
|
||||
prometheus
|
||||
];
|
||||
};
|
||||
|
|
@ -690,4 +749,29 @@ in
|
|||
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue