mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-18 02:05:51 +03:00
Merge pull request #41731 from andir/memcached-test
nixos/memcached: added simple set/get test
This commit is contained in:
commit
2b1915b9f6
@ -334,6 +334,7 @@ in rec {
|
||||
#tests.logstash = callTest tests/logstash.nix {};
|
||||
tests.mathics = callTest tests/mathics.nix {};
|
||||
tests.matrix-synapse = callTest tests/matrix-synapse.nix {};
|
||||
tests.memcached = callTest tests/memcached.nix {};
|
||||
tests.mesos = callTest tests/mesos.nix {};
|
||||
tests.misc = callTest tests/misc.nix {};
|
||||
tests.mongodb = callTest tests/mongodb.nix {};
|
||||
|
28
nixos/tests/memcached.nix
Normal file
28
nixos/tests/memcached.nix
Normal file
@ -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
Block a user