2018-04-30 11:59:53 +02:00
|
|
|
import ./make-test.nix ({ pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
name = "osquery";
|
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ ma27 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
machine = {
|
|
|
|
services.osquery.enable = true;
|
|
|
|
services.osquery.loggerPath = "/var/log/osquery/logs";
|
2018-12-19 22:53:53 +01:00
|
|
|
services.osquery.pidfile = "/run/osqueryd.pid";
|
2018-04-30 11:59:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
$machine->start;
|
|
|
|
$machine->waitForUnit("osqueryd.service");
|
|
|
|
|
|
|
|
$machine->succeed("echo 'SELECT address FROM etc_hosts LIMIT 1;' | osqueryi | grep '127.0.0.1'");
|
|
|
|
$machine->succeed(
|
|
|
|
"echo 'SELECT value FROM osquery_flags WHERE name = \"logger_path\";' | osqueryi | grep /var/log/osquery/logs"
|
|
|
|
);
|
|
|
|
|
2018-12-19 22:53:53 +01:00
|
|
|
$machine->succeed("echo 'SELECT value FROM osquery_flags WHERE name = \"pidfile\";' | osqueryi | grep /run/osqueryd.pid");
|
2018-04-30 11:59:53 +02:00
|
|
|
'';
|
|
|
|
})
|