1 import ./make-test-python.nix ({ pkgs, ... }:
5 meta.maintainers = [ pkgs.lib.maintainers.aanderse ];
10 # Ensure the virtual machine has enough memory for Solr to avoid the following error:
12 # OpenJDK 64-Bit Server VM warning:
13 # INFO: os::commit_memory(0x00000000e8000000, 402653184, 0)
14 # failed; error='Cannot allocate memory' (errno=12)
16 # There is insufficient memory for the Java Runtime Environment to continue.
17 # Native memory allocation (mmap) failed to map 402653184 bytes for committing reserved memory.
18 virtualisation.memorySize = 2000;
20 services.solr.enable = true;
26 machine.wait_for_unit("solr.service")
27 machine.wait_for_open_port(8983)
28 machine.succeed("curl --fail http://localhost:8983/solr/")
30 # adapted from pkgs.solr/examples/films/README.txt
31 machine.succeed("sudo -u solr solr create -c films")
32 assert '"status":0' in machine.succeed(
34 curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{
37 "type":"text_general",
42 "name":"initial_release_date",
50 "sudo -u solr post -c films ${pkgs.solr}/example/films/films.json"
52 assert '"name":"Batman Begins"' in machine.succeed(
53 "curl http://localhost:8983/solr/films/query?q=name:batman"