Repository navigation
fix(e2e): remove the classifier install a names case's setup script makes - #2159
Closed
norrietaylor wants to merge 1 commit into
Closed
norrietaylor wants to merge 1 commit into
norrietaylor wants to merge 1 commit into
Conversation
…akes Since the classifier item ships in min finalize-install, the script the native names cases run whole also installs the tree, the table, the step's copy and its units on a host with none. The lane's two classifier proofs install their own and refuse a host that already carries one, so the lane went red. Each case now removes what its script installed before it returns, and the teardown does for a run that died first; a host that already carried a classifier is left alone.
Contributor
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 4 minutes for your next included review. View limit details
Comment |
Contributor
|
Reading This comment updates when the review finishes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
mainhas been red onCI (Linux native)/native-daemon-e2esince #2144 merged (a7118306b); run 38025514203 fails inproof_host_ip_deny_all:From that job's log: the native names case prints
min finalize-install --show --script named the setup script (1173 lines)and thenran the advisory's command. Before #2144 that script carried the names block only; it now also carries the classifier block (the embedded step, hence the line count), because on a runner with no classifier the item readsmissing. The case runs the script whole under onesudo, which is its claim, so it installs the tree, the table, the root-owned copy, the ownership record and the three systemd units. It then reverts only what it knew about (the routing domain, the link, the answerer service). The next case's--show --scriptis 13 lines, which confirms the classifier item readdonefrom then on, and a later activate prints the classifier's "effect could not be read" note. The two classifier proofs later in the lane install their own tree and table and refuse a host that already carries one, so the first of them fails.Fix
scripts/session-e2e.shonly. The three native cases that run the setup script as root (proof_native_resolution_without_proxy_env,proof_box_name_resolves_natively_without_proxy,proof_native_answerer_survives_session_stop) now remove the classifier install their script made before they return, beside the answerer-service removal they already do:setup_classifier_note <script>runs just before thesudo -n sh. It setsSETUP_CLASSIFIER_INSTALLEDonly when the script carries the classifier block (its ownership-record line) and the host has neither the tree nor the record. A host that already carries a classifier is the host's own and is never removed.setup_classifier_teardownstops the daemon (the path unit placed it in the tree's daemon leaf, and the uninstall refuses while a process holds the tree), disablesminimald-place.path,minimald-place.serviceandminimald-classifier.serviceso no later daemon start in the lane is placed and nothing re-installs at boot, runs the step's own--uninstall(retried over a bounded wait for a box leaf that outlives the stop), then removes the unit files, the copy and the record. Each case fails if the tree is still there afterwards; the global teardown calls it best-effort for a run that died first.Why this and not the alternatives:
min finalize-installruns.min finalize-install --undowould also take away the names install and the AppArmor profile mid-lane.One product observation from the same log, not addressed here: after the script placed the already-running daemon, an activate reported
the classifier table's effect could not be read: the daemon's own control connection or the probe's placement failed, under which deny-all host-address boxes are refused until the daemon restarts. That is worth its own look.Test plan
just lint-shell→52 script(s) passed shellcheck;bash -n scripts/session-e2e.shclean.native-daemon-e2ejob: green atedd82b8e9in run 38026886894. Its log shows both names cases printing a 1173-line setup script (the second one finds the host without a classifier again, where the red run printed 13 lines), and the deny-all host-address proof running its decided half instead of refusing the host.