1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
4 # test is flaky on aarch64
5 broken = pkgs.stdenv.hostPlatform.isAarch64;
6 maintainers = [ lib.maintainers.devusb ];
9 nodes.sunshine = { config, pkgs, ... }: {
24 environment.systemPackages = with pkgs; [
30 nodes.moonlight = { config, pkgs, ... }: {
35 environment.systemPackages = with pkgs; [
44 # start the tests, wait for sunshine to be up
46 sunshine.wait_for_open_port(48010,"localhost")
48 # set the admin username/password, restart sunshine
49 sunshine.execute("sunshine --creds sunshine sunshine")
50 sunshine.systemctl("restart sunshine","root")
51 sunshine.wait_for_open_port(48010,"localhost")
53 # initiate pairing from moonlight
54 moonlight.execute("moonlight pair sunshine --pin 1234 >&2 & disown")
55 moonlight.wait_for_console_text("Executing request")
57 # respond to pairing request from sunshine
58 sunshine.succeed("curl --insecure -u sunshine:sunshine -d '{\"pin\": \"1234\"}' https://localhost:47990/api/pin")
60 # close moonlight once pairing complete
61 moonlight.send_key("kp_enter")
63 # put words on the sunshine screen for moonlight to see
64 sunshine.execute("gxmessage 'hello world' -center -font 'sans 75' >&2 & disown")
66 # connect to sunshine from moonlight and look for the words
67 moonlight.execute("moonlight --video-decoder software stream sunshine 'Desktop' >&2 & disown")
68 moonlight.wait_for_text("hello world")