1 import ./make-test-python.nix (
4 dependencyTrackPort = 8081;
7 name = "dependency-track";
9 maintainers = pkgs.lib.teams.cyberus.members;
21 environment.systemPackages = with pkgs; [ curl ];
22 systemd.services.dependency-track = {
23 # source: https://github.com/DependencyTrack/dependency-track/blob/37e0ba59e8057c18a87a7a76e247a8f75677a56c/dev/scripts/data-nist-generate-dummy.sh
27 NIST_DIR="$HOME/.dependency-track/nist"
32 for feed in $(seq "2024" "2002"); do
33 touch "$NIST_DIR/nvdcve-1.1-$feed.json.gz"
34 echo "9999999999999" > "$NIST_DIR/nvdcve-1.1-$feed.json.gz.ts"
38 services.dependency-track = {
40 port = dependencyTrackPort;
41 nginx.domain = "localhost";
42 database.passwordFile = "${pkgs.writeText "dbPassword" ''hunter2'THE'''H''''E''}";
52 server.wait_for_unit("dependency-track.service")
53 server.wait_until_succeeds(
54 "journalctl -o cat -u dependency-track.service | grep 'Dependency-Track is ready'"
56 server.wait_for_open_port(${toString dependencyTrackPort})
58 with subtest("version api returns correct version"):
60 server.succeed("curl http://localhost/api/version")
62 assert version["version"] == "${pkgs.dependency-track.version}"