Closed Bug 1673315 Opened 1 year ago Closed 1 year ago

Add a test to ensure loopback host names cannot be overridden

Categories

(Core :: Networking: DNS, task, P3)

task

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: fredw, Assigned: fredw)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

Depends on: 1673364
Summary: Ensure that loopback host names cannot be overridden → Add a test to ensure loopback host names cannot be overridden
Attachment #9183718 - Attachment description: Bug 1673315 Ensure that loopback host names cannot be overridden, r=valentin → Bug 1673315 Add a test to ensure loopback host names cannot be overridden, r=valentin
Severity: -- → N/A
Type: defect → task
Priority: -- → P3
Whiteboard: [necko-triaged]
Blocks: 1672323
Pushed by rmaries@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6e7c2bd7d2f7
Add a test to ensure loopback host names cannot be overridden, r=valentin,necko-reviewers

Backed out for failures on test_dns_override_for_localhost.js

backout: https://hg.mozilla.org/integration/autoland/rev/034317140549d9021ec0017ae5bf401aaa9a53b1

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=6e7c2bd7d2f7482a90798028befaab9f405e805d&group_state=expanded&selectedTaskRun=OAcgE8c-RqK0NP0E7gcHFQ.0

push with tier 1 failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=6de570466e661b7ce1b61c81587b5c5ae9506765&test_paths=netwerk%2Ftest%2Funit%2Fxpcshell.ini&selectedTaskRun=WVx5x_DaRgOsRA_WRo7T4Q.0

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=319894261&repo=autoland&lineNumber=4635

[task 2020-10-27T17:45:51.547Z] 17:45:51 INFO - TEST-START | netwerk/test/unit/test_dns_override_for_localhost.js
[task 2020-10-27T17:45:51.719Z] 17:45:51 WARNING - TEST-UNEXPECTED-FAIL | netwerk/test/unit/test_dns_override_for_localhost.js | xpcshell return code: 0
[task 2020-10-27T17:45:51.719Z] 17:45:51 INFO - TEST-INFO took 173ms
[task 2020-10-27T17:45:51.719Z] 17:45:51 INFO - >>>>>>>
[task 2020-10-27T17:45:51.719Z] 17:45:51 INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2020-10-27T17:45:51.719Z] 17:45:51 INFO - (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2020-10-27T17:45:51.719Z] 17:45:51 INFO - (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2020-10-27T17:45:51.719Z] 17:45:51 INFO - running event loop
[task 2020-10-27T17:45:51.719Z] 17:45:51 INFO - netwerk/test/unit/test_dns_override_for_localhost.js | Starting test_
[task 2020-10-27T17:45:51.720Z] 17:45:51 INFO - (xpcshell/head.js) | test test_ pending (2)
[task 2020-10-27T17:45:51.720Z] 17:45:51 INFO - (xpcshell/head.js) | test run_next_test 0 finished (2)
[task 2020-10-27T17:45:51.720Z] 17:45:51 WARNING - TEST-UNEXPECTED-FAIL | netwerk/test/unit/test_dns_override_for_localhost.js | test_ - [test_ : 63] localhost is not overridden - ["127.0.0.1"] deepEqual ["127.0.0.1","::1"]
[task 2020-10-27T17:45:51.720Z] 17:45:51 INFO - Z:/task_1603819874/build/tests/xpcshell/tests/netwerk/test/unit/test_dns_override_for_localhost.js:test_:63
[task 2020-10-27T17:45:51.720Z] 17:45:51 INFO - Z:\task_1603819874\build\tests\xpcshell\head.js:_do_main:248
[task 2020-10-27T17:45:51.720Z] 17:45:51 INFO - Z:\task_1603819874\build\tests\xpcshell\head.js:_execute_test:577
[task 2020-10-27T17:45:51.720Z] 17:45:51 INFO - -e:null:1
[task 2020-10-27T17:45:51.720Z] 17:45:51 INFO - exiting test

Flags: needinfo?(fred.wang)

(In reply to Natalia Csoregi [:nataliaCs] from comment #3)

[task 2020-10-27T17:45:51.720Z] 17:45:51 WARNING - TEST-UNEXPECTED-FAIL | netwerk/test/unit/test_dns_override_for_localhost.js | test_ - [test_ : 63] localhost is not overridden - ["127.0.0.1"] deepEqual ["127.0.0.1","::1"]

So it looks like windows only resolve to IPv4 loopback, not IPv6.

@valentin Do you have idea why? Should I try to relax the test equality? Or instead add specific failure expectation on Windows?

Flags: needinfo?(fred.wang) → needinfo?(valentin.gosu)

It seems the problem stems from here:
https://searchfox.org/mozilla-central/rev/c409dd9235c133ab41eba635f906aa16e050c197/testing/xpcshell/head.js#128
Not exactly sure why that is.

I guess you can just set the pref to "" at the start of the test for now.
Could you also do a try push removing that line from head.js to see what fails? It's not clear to me why that happens. Maybe we can fix it in a followup bug.

Flags: needinfo?(valentin.gosu)

(In reply to Valentin Gosu [:valentin] (he/him) from comment #5)

It seems the problem stems from here:
https://searchfox.org/mozilla-central/rev/c409dd9235c133ab41eba635f906aa16e050c197/testing/xpcshell/head.js#128
Not exactly sure why that is.
Could you also do a try push removing that line from head.js to see what fails? It's not clear to me why that happens. Maybe we can fix it in a followup bug.

This seems quite old code. I pushed this: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b23ff519ac9de21557f31d6216ec5532b0228507

I guess you can just set the pref to "" at the start of the test for now.

OK, I'll try that. Thanks!

Depends on: 1673856
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/cef3f7c75bc0
Add a test to ensure loopback host names cannot be overridden, r=valentin,necko-reviewers
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.