nixosTests.go-camo: handleTest -> runTest, go-camo: link nixos test (#423699)

This commit is contained in:
Michele Guerini Rocco
2025-07-10 22:30:30 +02:00
committed by GitHub
3 changed files with 27 additions and 32 deletions
+1 -1
View File
@@ -605,7 +605,7 @@ in
gns3-server = runTest ./gns3-server.nix;
gnupg = runTest ./gnupg.nix;
goatcounter = runTest ./goatcounter.nix;
go-camo = handleTest ./go-camo.nix { };
go-camo = runTest ./go-camo.nix;
go-neb = runTest ./go-neb.nix;
gobgpd = runTest ./gobgpd.nix;
gocd-agent = runTest ./gocd-agent.nix;
+21 -31
View File
@@ -1,36 +1,26 @@
{ lib, ... }:
let
key_val = "12345678";
in
{
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../.. { inherit system config; },
}:
name = "go-camo-file-key";
meta = {
maintainers = [ lib.maintainers.viraptor ];
};
with import ../lib/testing-python.nix { inherit system pkgs; };
{
gocamo_file_key =
let
key_val = "12345678";
in
makeTest {
name = "go-camo-file-key";
meta = {
maintainers = [ pkgs.lib.maintainers.viraptor ];
nodes.machine =
{ pkgs, ... }:
{
services.go-camo = {
enable = true;
keyFile = pkgs.writeText "foo" key_val;
};
nodes.machine =
{ config, pkgs, ... }:
{
services.go-camo = {
enable = true;
keyFile = pkgs.writeText "foo" key_val;
};
};
# go-camo responds to http requests
testScript = ''
machine.wait_for_unit("go-camo.service")
machine.wait_for_open_port(8080)
machine.succeed("curl http://localhost:8080")
'';
};
# go-camo responds to http requests
testScript = ''
machine.wait_for_unit("go-camo.service")
machine.wait_for_open_port(8080)
machine.succeed("curl http://localhost:8080")
'';
}
+5
View File
@@ -3,6 +3,7 @@
buildGo124Module,
fetchFromGitHub,
installShellFiles,
nixosTests,
scdoc,
}:
@@ -43,6 +44,10 @@ buildGo124Module rec {
rm pkg/camo/proxy_{,filter_}test.go
'';
passthru.tests = {
inherit (nixosTests) go-camo;
};
meta = {
description = "Camo server is a special type of image proxy that proxies non-secure images over SSL/TLS";
homepage = "https://github.com/cactus/go-camo";