summary refs log tree commit diff
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2023-10-22 19:12:26 +0200
committerpennae <github@quasiparticle.net>2023-10-22 19:12:26 +0200
commit33ba318db61ace54adb5691d98368339f3f25e25 (patch)
treef53a9d0eab0dbd1ae171fae983531fbd0d429c52
parent5883b305e7e0a32938805d3646f1ebd7e11aaab0 (diff)
downloadnixpkgs-33ba318db61ace54adb5691d98368339f3f25e25.tar
nixpkgs-33ba318db61ace54adb5691d98368339f3f25e25.tar.gz
nixpkgs-33ba318db61ace54adb5691d98368339f3f25e25.tar.bz2
nixpkgs-33ba318db61ace54adb5691d98368339f3f25e25.tar.lz
nixpkgs-33ba318db61ace54adb5691d98368339f3f25e25.tar.xz
nixpkgs-33ba318db61ace54adb5691d98368339f3f25e25.tar.zst
nixpkgs-33ba318db61ace54adb5691d98368339f3f25e25.zip
nixos/mosquitto: remove the bind_interface test
bind_interface is the mosquitto way of trying to bind to all addresses
on an interface, but it is unreliable (trying to bind to link-local v6
addresses *sometimes* but not always) and just prone to failure in
general for reasons we have yet to discover.

since this kind of automatic behavior isn't particularly necessary in a
declarative system we may as well skip it.
-rw-r--r--nixos/tests/mosquitto.nix28
1 files changed, 0 insertions, 28 deletions
diff --git a/nixos/tests/mosquitto.nix b/nixos/tests/mosquitto.nix
index 8eca4f25922..c0980b23e78 100644
--- a/nixos/tests/mosquitto.nix
+++ b/nixos/tests/mosquitto.nix
@@ -4,7 +4,6 @@ let
   port = 1888;
   tlsPort = 1889;
   anonPort = 1890;
-  bindTestPort = 18910;
   password = "VERY_secret";
   hashedPassword = "$7$101$/WJc4Mp+I+uYE9sR$o7z9rD1EYXHPwEP5GqQj6A7k4W1yVbePlb8TqNcuOLV9WNCiDgwHOB0JHC1WCtdkssqTBduBNUnUGd6kmZvDSw==";
   topic = "test/foo";
@@ -127,10 +126,6 @@ in {
               };
             };
           }
-          {
-            settings.bind_interface = "eth0";
-            port = bindTestPort;
-          }
         ];
       };
     };
@@ -140,8 +135,6 @@ in {
   };
 
   testScript = ''
-    import json
-
     def mosquitto_cmd(binary, user, topic, port):
         return (
             "mosquitto_{} "
@@ -174,27 +167,6 @@ in {
     start_all()
     server.wait_for_unit("mosquitto.service")
 
-    with subtest("bind_interface"):
-        addrs = dict()
-        for iface in json.loads(server.succeed("ip -json address show")):
-            for addr in iface['addr_info']:
-                # don't want to deal with multihoming here
-                assert addr['local'] not in addrs
-                addrs[addr['local']] = (iface['ifname'], addr['family'])
-
-        # mosquitto grabs *one* random address per type for bind_interface
-        (has4, has6) = (False, False)
-        for line in server.succeed("ss -HlptnO sport = ${toString bindTestPort}").splitlines():
-            items = line.split()
-            if "mosquitto" not in items[5]: continue
-            listener = items[3].rsplit(':', maxsplit=1)[0].strip('[]')
-            assert listener in addrs
-            assert addrs[listener][0] == "eth0"
-            has4 |= addrs[listener][1] == 'inet'
-            has6 |= addrs[listener][1] == 'inet6'
-        assert has4
-        assert has6
-
     with subtest("check passwords"):
         client1.succeed(publish("-m test", "password_store"))
         client1.succeed(publish("-m test", "password_file"))