]> Cypherpunks repositories - gostls13.git/commit
net: fix TestUpdateResolvConf after CL 18860
authorMatthew Dempsky <mdempsky@google.com>
Sun, 21 Feb 2016 04:33:34 +0000 (20:33 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Sun, 21 Feb 2016 20:59:45 +0000 (20:59 +0000)
commit8caf19c46f9d7cc9011d7acdc464768b5fb15d7e
treea4e41ffd7d03cc75fa156c9539e8c2f436efc720
parent8ffe496ae792a1cdc845c1c019323cf6c05fbb32
net: fix TestUpdateResolvConf after CL 18860

When writing a fake dnsConfig to conf.dnsConfig, set lastChecked to an
hour into the future.  This causes dnsclient_unix.go's
tryUpdate("/etc/resolv.conf") calls to short-circuit and ignore that
/etc/resolv.conf's mtime differs from the test's fake resolv.conf
file.  We only need to zero out lastChecked in teardown.

While here, this makes two other tryUpdate(conf.path) test calls
pointless, since they'll now short circuit too.

Fixes #14437.

Change-Id: Ieb520388e319b9826dfa49f134907f4927608a53
Reviewed-on: https://go-review.googlesource.com/19777
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
src/net/dnsclient_unix_test.go