From fa0f7ea7f303de0337307c829d822ea7c62524f1 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Thu, 25 Mar 2021 16:14:06 -0400
Subject: [PATCH] demonstrate that we have the new openssl

actually, test fails, so it demonstrates we don't
---
 nixos/lib/tests/test_openssl.nix | 6 ++++++
 nixos/openssl-111k.nix           | 3 ++-
 nixos/unit-tests.nix             | 7 ++-----
 3 files changed, 10 insertions(+), 6 deletions(-)
 create mode 100644 nixos/lib/tests/test_openssl.nix

diff --git a/nixos/lib/tests/test_openssl.nix b/nixos/lib/tests/test_openssl.nix
new file mode 100644
index 00000000..44c13ff1
--- /dev/null
+++ b/nixos/lib/tests/test_openssl.nix
@@ -0,0 +1,6 @@
+openssl:
+{ test_version =
+  { expected = "1.1.1k";
+    expr = "${openssl.version}";
+  };
+}
diff --git a/nixos/openssl-111k.nix b/nixos/openssl-111k.nix
index aff3434c..38fd4a89 100644
--- a/nixos/openssl-111k.nix
+++ b/nixos/openssl-111k.nix
@@ -1,4 +1,4 @@
-self: super: {
+self: super: rec {
   openssl_1_1 = super.openssl_1_1.overrideAttrs (old: rec {
     version = "1.1.1k";
     pname = "openssl";
@@ -8,4 +8,5 @@ self: super: {
       sha256 = "1rdfzcrxy9y38wqdw5942vmdax9hjhgrprzxm42csal7p5shhal9";
     };
   });
+  openssl = openssl_1_1;
 }
diff --git a/nixos/unit-tests.nix b/nixos/unit-tests.nix
index 75016a17..b9bb6748 100644
--- a/nixos/unit-tests.nix
+++ b/nixos/unit-tests.nix
@@ -5,14 +5,11 @@ let
   # Total the numbers in a list.
   sum = builtins.foldl' (a: b: a + b) 0;
 
-  # A helper for loading tests.
-  loadTest = moduleUnderTest: testModule:
-    (import testModule (pkgs.callPackage moduleUnderTest { }));
-
   # A list of tests to run.  Manually updated for now, alas.  Only tests in
   # this list will be run!
   testModules =
-  [ (loadTest ./lib/ini.nix ./lib/tests/test_ini.nix)
+  [ (import ./lib/tests/test_ini.nix (pkgs.callPackage ./lib/ini.nix { }))
+    (import ./lib/tests/test_openssl.nix pkgs.openssl)
   ];
 
   # Count up the tests we're going to run.
-- 
GitLab