Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/tinydns: port test to python #73059

Merged
merged 2 commits into from Nov 9, 2019

Conversation

@flokli
Copy link
Contributor

flokli commented Nov 8, 2019

Motivation for this change

#72828

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @worldofpeace @tfc

flokli added 2 commits Nov 8, 2019
In cases where you boot up really quickly (like in the VM test on a
non-busy host), tinydns might want to bind before the loopback interface
is fully up. Order tinydns after network.target to fix that.
@flokli flokli force-pushed the flokli:nixos-test-port-tinydns branch from c57dd5e to caac096 Nov 8, 2019
@flokli

This comment has been minimized.

Copy link
Contributor Author

flokli commented Nov 8, 2019

There was some flakyness in the tests, as sometimes tinydns.service wanted to bind before network.target was reached. Fixed by adding a after line to the tinydns.service defined in the NixOS module.

@rnhmjoj

This comment has been minimized.

Copy link
Contributor

rnhmjoj commented Nov 8, 2019

@GrahamcOfBorg test tinydns

@@ -37,6 +37,7 @@ with lib;
systemd.services.tinydns = {
description = "djbdns tinydns server";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];

This comment has been minimized.

Copy link
@rnhmjoj

rnhmjoj Nov 8, 2019

Contributor

You should never use network.target: it's meant to be pulled in by services providing the network link/setup, like dhcpcd. Use network-online.target instead. See #50930 (comment)

This comment has been minimized.

Copy link
@flokli

flokli Nov 8, 2019

Author Contributor

Does tinydns fail horribly during startup if there's no default route? Otherwise, systemd docs explicitly mention we should go after network.target, not network-online.target:

Units that strictly require a configured network connection should pull in network-online.target (via a Wants= type dependency) and order themselves after it. This target unit is intended to pull in a service that delays further execution until the network is sufficiently set up. What precisely this requires is left to the implementation of the network managing service.

This comment has been minimized.

Copy link
@rnhmjoj

rnhmjoj Nov 8, 2019

Contributor

Does tinydns fail horribly during startup if there's no default route?

Probably not but it's logically not part of setting up the network link and needs an internet connection.

This comment has been minimized.

Copy link
@flokli

flokli Nov 8, 2019

Author Contributor

We don't set wants, or make it partOf network.target - we only set an after.

Setting After=network-online.target would mean we wait with starting tinydns until there's a default route. This means if you're enabling tinydns on your laptop, you don't reach multi-user.target until you get an internet connection.

I don't think that's necessary, but tinydns needs to wait until there's a network interface available in the system, so setting After=network.target should be right. 😕

This comment has been minimized.

Copy link
@rnhmjoj

rnhmjoj Nov 8, 2019

Contributor

Oh, you are right: I was confusing After with Wants, sorry.

This comment has been minimized.

Copy link
@flokli

flokli Nov 8, 2019

Author Contributor

No worries!

@tfc
tfc approved these changes Nov 9, 2019
@rnhmjoj
rnhmjoj approved these changes Nov 9, 2019
@worldofpeace worldofpeace merged commit 488e6b7 into NixOS:master Nov 9, 2019
14 checks passed
14 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
tests.tinydns on aarch64-linux Success
Details
tests.tinydns on x86_64-linux Success
Details
@flokli flokli deleted the flokli:nixos-test-port-tinydns branch Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.