summary refs log tree commit diff
path: root/nixos/tests/handbrake.nix
blob: e5fb6b269b19721cd6c2d3e59343d5541020e522 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import ./make-test-python.nix ({ pkgs, ... }:
let
  # Download Big Buck Bunny example, licensed under CC Attribution 3.0.
  testMkv = pkgs.fetchurl {
    url = "https://github.com/Matroska-Org/matroska-test-files/blob/cf0792be144ac470c4b8052cfe19bb691993e3a2/test_files/test1.mkv?raw=true";
    sha256 = "1hfxbbgxwfkzv85pvpvx55a72qsd0hxjbm9hkl5r3590zw4s75h9";
  };
in {
  name = "handbrake";

  meta = {
    maintainers = with pkgs.stdenv.lib.maintainers; [ danieldk ];
  };

  machine = { pkgs, ... }: {
    environment.systemPackages = with pkgs; [ handbrake ];
  };

  testScript = ''
    # Test MP4 and MKV transcoding. Since this is a short clip, transcoding typically
    # only takes a few seconds.
    start_all()

    machine.succeed(
        "HandBrakeCLI -i ${testMkv} -o test.mp4 -e x264 -q 20 -B 160"
    )
    machine.succeed(
        "HandBrakeCLI -i ${testMkv} -o test.mkv -e x264 -q 20 -B 160"
    )
  '';
})