git » kxd » commit 0150a93

Require Go >= 1.11

author Alberto Bertogli
2019-08-09 08:51:11 UTC
committer Alberto Bertogli
2019-08-10 09:33:22 UTC
parent 3de6bbdb5e5e09d24caab62b3cfd45a20b2981f7

Require Go >= 1.11

Debian stable (which we generally use as reference) was recently
released with Go 1.11, and bumping the version allows us to enable a few
tests that were not valid in <= 1.7.

So bump the required version to 1.11, which is higher than strictly
needed as per current code, but by now it should be a reasonable
requirement.

.travis.yml +1 -2
README +1 -1
tests/run_tests +7 -15

diff --git a/.travis.yml b/.travis.yml
index 2225d3c..6b7fb2f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,8 +4,7 @@ language: go
 go_import_path: blitiri.com.ar/go/kxd
 
 go:
-    - 1.7  # Debian stable relies on this.
-    - 1.8
+    - 1.11  # Debian stable.
     - tip
 
 addons:
diff --git a/README b/README
index a67c8c6..b707742 100644
--- a/README
+++ b/README
@@ -75,7 +75,7 @@ Dependencies
 
 There are no runtime dependencies for the kxd and kxc binaries.
 
-Building requires Go 1.7.
+Building requires Go 1.11.
 
 The configuration helper scripts (create-kxd-config, kxc-add-key, etc.)
 depend on: bash, openssl (the binary), and core utilities (mkdir, dd, etc.).
diff --git a/tests/run_tests b/tests/run_tests
index a1c5691..0bd3a34 100755
--- a/tests/run_tests
+++ b/tests/run_tests
@@ -502,12 +502,8 @@ class Delegation(TestCase):
 
         # The server is signed by the CA, but the CA is unknown to the client.
         # But the client knows the server directly, so it's allowed.
-        #
-        # NOTE: go <= 1.7 rejected this case, it was only allowed during the
-        # 1.8 development cycle (8ad70a5), so comment it out for now.
-        #
-        #key = self.client.call(self.server.cert_path(), "kxd://localhost/k1")
-        #self.assertEquals(key, self.server.keys["k1"])
+        key = self.client.call(self.server.cert_path(), "kxd://localhost/k1")
+        self.assertEquals(key, self.server.keys["k1"])
 
         # Same as above, but give the wrong CA.
         ca2 = CA()
@@ -536,15 +532,11 @@ class Delegation(TestCase):
 
         # The client is signed by the CA, but the CA is unknown to the server.
         # But the server it knows the client directly, so it's allowed.
-        #
-        # NOTE: go <= 1.7 rejected this case, it was only allowed during the
-        # 1.8 development cycle (8ad70a5), so comment it out for now.
-        #
-        #self.server.new_key("k3",
-        #                    allowed_clients=[self.client.cert()],
-        #                    allowed_hosts=["localhost"])
-        #key = self.client.call(self.server.cert_path(), "kxd://localhost/k3")
-        #self.assertEquals(key, self.server.keys["k3"])
+        self.server.new_key("k3",
+                            allowed_clients=[self.client.cert()],
+                            allowed_hosts=["localhost"])
+        key = self.client.call(self.server.cert_path(), "kxd://localhost/k3")
+        self.assertEquals(key, self.server.keys["k3"])
 
     def test_both_delegated(self):
         self.prepare(server_self_sign=False, client_self_sign=False)