nixos/memcached: added simple set/get test
The test ensures that the services comes up and accepts/provides values.
This commit is contained in:
parent
500f1a9438
commit
1305752ba0
|
@ -334,6 +334,7 @@ in rec {
|
||||||
#tests.logstash = callTest tests/logstash.nix {};
|
#tests.logstash = callTest tests/logstash.nix {};
|
||||||
tests.mathics = callTest tests/mathics.nix {};
|
tests.mathics = callTest tests/mathics.nix {};
|
||||||
tests.matrix-synapse = callTest tests/matrix-synapse.nix {};
|
tests.matrix-synapse = callTest tests/matrix-synapse.nix {};
|
||||||
|
tests.memcached = callTest tests/memcached.nix {};
|
||||||
tests.mesos = callTest tests/mesos.nix {};
|
tests.mesos = callTest tests/mesos.nix {};
|
||||||
tests.misc = callTest tests/misc.nix {};
|
tests.misc = callTest tests/misc.nix {};
|
||||||
tests.mongodb = callTest tests/mongodb.nix {};
|
tests.mongodb = callTest tests/mongodb.nix {};
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
import ./make-test.nix ({ pkgs, ...} : {
|
||||||
|
name = "memcached";
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
machine =
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
imports = [ ../modules/profiles/minimal.nix ];
|
||||||
|
services.memcached.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = let
|
||||||
|
testScript = pkgs.writeScript "testScript.py" ''
|
||||||
|
#!${pkgs.python3.withPackages (p: [p.memcached])}/bin/python
|
||||||
|
|
||||||
|
import memcache
|
||||||
|
c = memcache.Client(['localhost:11211'])
|
||||||
|
c.set('key', 'value')
|
||||||
|
assert 'value' == c.get('key')
|
||||||
|
'';
|
||||||
|
in ''
|
||||||
|
startAll;
|
||||||
|
$machine->waitForUnit("memcached.service");
|
||||||
|
$machine->waitForOpenPort("11211");
|
||||||
|
$machine->succeed("${testScript}");
|
||||||
|
'';
|
||||||
|
})
|
Loading…
Reference in New Issue