summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniël de Kok <me@danieldk.eu>2018-11-12 07:45:00 +0100
committerDaniël de Kok <me@danieldk.eu>2018-11-12 08:19:58 +0100
commit40f41772aa68f8bb4f04ec78cdee612ea8701259 (patch)
treebdec75ba524c4c95389155e9b485f107a26e41fc
parent6c2050fd9cc53cd08af85d8e516316a6e7cc5955 (diff)
downloadnixpkgs-40f41772aa68f8bb4f04ec78cdee612ea8701259.tar
nixpkgs-40f41772aa68f8bb4f04ec78cdee612ea8701259.tar.gz
nixpkgs-40f41772aa68f8bb4f04ec78cdee612ea8701259.tar.bz2
nixpkgs-40f41772aa68f8bb4f04ec78cdee612ea8701259.tar.lz
nixpkgs-40f41772aa68f8bb4f04ec78cdee612ea8701259.tar.xz
nixpkgs-40f41772aa68f8bb4f04ec78cdee612ea8701259.tar.zst
nixpkgs-40f41772aa68f8bb4f04ec78cdee612ea8701259.zip
tests: handbrake: test transcoding to MKV and MP4.
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/handbrake.nix25
2 files changed, 26 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 718a95dadd2..754a8ff20b2 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -88,6 +88,7 @@ in
   graphite = handleTest ./graphite.nix {};
   hadoop.hdfs = handleTestOn [ "x86_64-linux" ] ./hadoop/hdfs.nix {};
   hadoop.yarn = handleTestOn [ "x86_64-linux" ] ./hadoop/yarn.nix {};
+  handbrake = handleTestOn ["x86_64-linux"] ./handbrake.nix {};
   haproxy = handleTest ./haproxy.nix {};
   #hardened = handleTest ./hardened.nix {}; # broken due useSandbox = true
   hibernate = handleTest ./hibernate.nix {};
diff --git a/nixos/tests/handbrake.nix b/nixos/tests/handbrake.nix
new file mode 100644
index 00000000000..ae87e1f69a7
--- /dev/null
+++ b/nixos/tests/handbrake.nix
@@ -0,0 +1,25 @@
+import ./make-test.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.
+    $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");
+  '';
+})