From 6225fc5303b8d6c9972657ff7ff1270d5e16bb4e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 27 Nov 2019 10:50:26 +0100 Subject: [PATCH] nixos/nextcloud: port tests to python test-driver --- nixos/tests/nextcloud/basic.nix | 18 +++++++++------- .../nextcloud/with-mysql-and-memcached.nix | 21 +++++++++++-------- .../nextcloud/with-postgresql-and-redis.nix | 20 +++++++++++------- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/nixos/tests/nextcloud/basic.nix b/nixos/tests/nextcloud/basic.nix index bfb97ec3f23..75862feb202 100644 --- a/nixos/tests/nextcloud/basic.nix +++ b/nixos/tests/nextcloud/basic.nix @@ -1,4 +1,4 @@ -import ../make-test.nix ({ pkgs, ...}: let +import ../make-test-python.nix ({ pkgs, ...}: let adminpass = "notproduction"; adminuser = "root"; in { @@ -50,11 +50,15 @@ in { diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file) ''; in '' - startAll(); - $nextcloud->waitForUnit("multi-user.target"); - $nextcloud->succeed("curl -sSf http://nextcloud/login"); - $nextcloud->succeed("${withRcloneEnv} ${copySharedFile}"); - $client->waitForUnit("multi-user.target"); - $client->succeed("${withRcloneEnv} ${diffSharedFile}"); + start_all() + nextcloud.wait_for_unit("multi-user.target") + nextcloud.succeed("curl -sSf http://nextcloud/login") + nextcloud.succeed( + "${withRcloneEnv} ${copySharedFile}" + ) + client.wait_for_unit("multi-user.target") + client.succeed( + "${withRcloneEnv} ${diffSharedFile}" + ) ''; }) diff --git a/nixos/tests/nextcloud/with-mysql-and-memcached.nix b/nixos/tests/nextcloud/with-mysql-and-memcached.nix index aaf37ee4c81..b9ba5888187 100644 --- a/nixos/tests/nextcloud/with-mysql-and-memcached.nix +++ b/nixos/tests/nextcloud/with-mysql-and-memcached.nix @@ -1,4 +1,4 @@ -import ../make-test.nix ({ pkgs, ...}: let +import ../make-test-python.nix ({ pkgs, ...}: let adminpass = "hunter2"; adminuser = "root"; in { @@ -85,13 +85,16 @@ in { diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file) ''; in '' - startAll(); - $nextcloud->waitForUnit("multi-user.target"); - $nextcloud->succeed("${configureMemcached}"); - $nextcloud->succeed("curl -sSf http://nextcloud/login"); - $nextcloud->succeed("${withRcloneEnv} ${copySharedFile}"); - $client->waitForUnit("multi-user.target"); - $client->succeed("${withRcloneEnv} ${diffSharedFile}"); - + start_all() + nextcloud.wait_for_unit("multi-user.target") + nextcloud.succeed("${configureMemcached}") + nextcloud.succeed("curl -sSf http://nextcloud/login") + nextcloud.succeed( + "${withRcloneEnv} ${copySharedFile}" + ) + client.wait_for_unit("multi-user.target") + client.succeed( + "${withRcloneEnv} ${diffSharedFile}" + ) ''; }) diff --git a/nixos/tests/nextcloud/with-postgresql-and-redis.nix b/nixos/tests/nextcloud/with-postgresql-and-redis.nix index f655aba9d45..324853350af 100644 --- a/nixos/tests/nextcloud/with-postgresql-and-redis.nix +++ b/nixos/tests/nextcloud/with-postgresql-and-redis.nix @@ -1,4 +1,4 @@ -import ../make-test.nix ({ pkgs, ...}: let +import ../make-test-python.nix ({ pkgs, ...}: let adminpass = "hunter2"; adminuser = "custom-admin-username"; in { @@ -85,12 +85,16 @@ in { diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file) ''; in '' - startAll(); - $nextcloud->waitForUnit("multi-user.target"); - $nextcloud->succeed("${configureRedis}"); - $nextcloud->succeed("curl -sSf http://nextcloud/login"); - $nextcloud->succeed("${withRcloneEnv} ${copySharedFile}"); - $client->waitForUnit("multi-user.target"); - $client->succeed("${withRcloneEnv} ${diffSharedFile}"); + start_all() + nextcloud.wait_for_unit("multi-user.target") + nextcloud.succeed("${configureRedis}") + nextcloud.succeed("curl -sSf http://nextcloud/login") + nextcloud.succeed( + "${withRcloneEnv} ${copySharedFile}" + ) + client.wait_for_unit("multi-user.target") + client.succeed( + "${withRcloneEnv} ${diffSharedFile}" + ) ''; })