2018-06-09 00:05:21 +00:00
|
|
|
import ./make-test.nix ({ pkgs, ...} : {
|
|
|
|
name = "memcached";
|
|
|
|
|
|
|
|
nodes = {
|
|
|
|
machine =
|
2018-07-20 20:56:59 +00:00
|
|
|
{ ... }:
|
2018-06-09 00:05:21 +00:00
|
|
|
{
|
|
|
|
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}");
|
|
|
|
'';
|
|
|
|
})
|