git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #122627 from primeos/nixos-tests-signal-desktop-db-encryption

nixos/tests/signal-desktop: test if the SQLite DB is (un)encrypted

commit28a1e9516d297ba7c18276949c6bbeb933dfd961 authorMichael Weiss <dev.primeos@gmail.com> dateThu 13 May 2021, 21:40 (6 years ago) parentec4814a217f268
1 file changed+14−2
nixos/tests/signal-desktop.nix+14−2
nixos/tests/signal-desktop.nix+14−2
@@ -3,7 +3,7 @@ import ./make-test-python.nix ({ pkgs, ...} :
33{
44 name = "signal-desktop";
55 meta = with pkgs.lib.maintainers; {
6− maintainers = [ flokli ];
6+ maintainers = [ flokli primeos ];
77 };
88
99 machine = { ... }:
@@ -16,7 +16,7 @@ import ./make-test-python.nix ({ pkgs, ...} :
1616
1717 services.xserver.enable = true;
1818 test-support.displayManager.auto.user = "alice";
19− environment.systemPackages = [ pkgs.signal-desktop ];
19+ environment.systemPackages = with pkgs; [ signal-desktop file ];
2020 virtualisation.memorySize = 1024;
2121 };
2222
@@ -39,5 +39,17 @@ import ./make-test-python.nix ({ pkgs, ...} :
3939 machine.wait_for_text("Signal")
4040 machine.wait_for_text("File Edit View Window Help")
4141 machine.screenshot("signal_desktop")
42+
43+ # Test if the database is encrypted to prevent these issues:
44+ # - https://github.com/NixOS/nixpkgs/issues/108772
45+ # - https://github.com/NixOS/nixpkgs/pull/117555
46+ print(machine.succeed("su - alice -c 'file ~/.config/Signal/sql/db.sqlite'"))
47+ # TODO: The DB should be encrypted and the following should be machine.fail
48+ # instead of machine.succeed but the DB is currently unencrypted and we
49+ # want to notice if this isn't the case anymore as the transition to a
50+ # encrypted DB can cause data loss!:
51+ machine.succeed(
52+ "su - alice -c 'file ~/.config/Signal/sql/db.sqlite' | grep -i sqlite"
53+ )
4254 '';
4355})