Commit 0233be9d authored by Pasha Fistanto's avatar Pasha Fistanto
Browse files

nixosTests.syncthing-folders: Test IDs with white space

parent 2f2bbb21
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -50,6 +50,12 @@ in
              ];
              ignorePatterns = [ ];
            };
            folders."foo bar" = {
              path = "/var/lib/syncthing/foo-bar";
              devices = [
                "b"
              ];
            };
          };
        };
      };
@@ -88,6 +94,16 @@ in
                "notB"
              ];
            };
            # Test how we handle white spaces in folder IDs
            folders."foo bar" = {
              path = "/var/lib/syncthing/foo-bar";
              devices = [
                "a"
              ];
              ignorePatterns = [
                "notB"
              ];
            };
          };
        };
      };
@@ -183,5 +199,20 @@ in
    # Check that files have been correctly ignored
    b.fail("cat /var/lib/syncthing/baz/notB")
    c.fail("cat /var/lib/syncthing/baz/notC")

    # Test foo bar

    a.wait_for_file("/var/lib/syncthing/foo-bar")
    b.wait_for_file("/var/lib/syncthing/foo-bar")

    a.succeed("echo a2b > /var/lib/syncthing/foo-bar/a2b")
    a.succeed("echo a2b > /var/lib/syncthing/foo-bar/notB")
    b.succeed("echo b2a > /var/lib/syncthing/foo-bar/b2a")

    a.wait_for_file("/var/lib/syncthing/foo-bar/b2a")
    b.wait_for_file("/var/lib/syncthing/foo-bar/a2b")

    # Check that file has been correctly ignored
    b.fail("cat /var/lib/syncthing/foo-bar/notB")
  '';
}