1 import ../make-test-python.nix (
5 meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];
13 address = "192.168.2.10";
18 firewall.allowedTCPPorts = [
24 services.postgresql = {
27 ensureDatabases = [ "peertube_test" ];
30 name = "peertube_test";
31 ensureDBOwnership = true;
35 hostnossl peertube_test peertube_test 192.168.2.11/32 md5
37 initialScript = pkgs.writeText "postgresql_init.sql" ''
38 CREATE ROLE peertube_test LOGIN PASSWORD '0gUN0C1mgST6czvjZ8T9';
42 services.redis.servers.peertube = {
45 requirePass = "turrQfaQwnanGbcsdhxy";
55 "peertube/password-init-root".text = ''
56 PT_INITIAL_ROOT_PASSWORD=zw4SqYVdcsXUfRX8aaFX
58 "peertube/secrets-peertube".text = ''
59 063d9c60d519597acef26003d5ecc32729083965d09181ef3949200cbe5f09ee
61 "peertube/password-posgressql-db".text = ''
64 "peertube/password-redis-db".text = ''
74 address = "192.168.2.11";
80 192.168.2.11 peertube.local
82 firewall.allowedTCPPorts = [ 9000 ];
87 localDomain = "peertube.local";
88 enableWebHttps = false;
90 serviceEnvironmentFile = "/etc/peertube/password-init-root";
93 secretsFile = "/etc/peertube/secrets-peertube";
97 host = "192.168.2.10";
98 name = "peertube_test";
99 user = "peertube_test";
100 passwordFile = "/etc/peertube/password-posgressql-db";
104 host = "192.168.2.10";
106 passwordFile = "/etc/peertube/password-redis-db";
111 hostname = "0.0.0.0";
114 name = "PeerTube Test Server";
121 environment.systemPackages = [
129 address = "192.168.2.12";
135 192.168.2.11 peertube.local
145 database.wait_for_unit("postgresql.service")
146 database.wait_for_unit("redis-peertube.service")
148 database.wait_for_open_port(5432)
149 database.wait_for_open_port(31638)
151 server.wait_for_unit("peertube.service")
152 server.wait_for_open_port(9000)
154 # Check if PeerTube is running
155 client.succeed("curl --fail http://peertube.local:9000/api/v1/config/about | jq -r '.instance.name' | grep 'PeerTube\ Test\ Server'")
157 # Check PeerTube CLI version
158 client.succeed('peertube-cli auth add -u "http://peertube.local:9000" -U "root" --password "zw4SqYVdcsXUfRX8aaFX"')
159 client.succeed('peertube-cli auth list | grep "http://peertube.local:9000"')
160 client.succeed('peertube-cli auth del "http://peertube.local:9000"')
161 client.fail('peertube-cli auth list | grep "http://peertube.local:9000"')