Mageia Bugzilla – Attachment 2238 Details for
Bug 5772
Ethernet test fails when adding additional media
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
patch for drakx-net
5772.diff (text/plain), 831 bytes, created by
Thierry Vignaud
on 2012-05-10 09:43:17 CEST
(
hide
)
Description:
patch for drakx-net
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2012-05-10 09:43:17 CEST
Size:
831 bytes
patch
obsolete
>diff --git a/lib/network/tools.pm b/lib/network/tools.pm >index 04bd343..8628bc2 100644 >--- a/lib/network/tools.pm >+++ b/lib/network/tools.pm >@@ -47,7 +47,15 @@ sub stop_net_interface { > stop_interface($net->{net_interface}, $detach); > } > >-sub connected() { gethostbyname("www.mageia.org") ? 1 : 0 } >+sub connected() { >+ if ($::isInstall) { >+ # gethostbyname() only reads /etc/resolv.conf once so if resolv.conf is >+ # not present when the test begins, writing it later is not going to help: >+ symlink "$::prefix/etc/resolv.conf", "/etc/resolv.conf" if ! -e "/etc/resolv.conf"; >+ return scalar grep { /1 received/ } `$::prefix/bin/ping -qc1 www.mageia.org`; >+ } >+ gethostbyname("www.mageia.org") ? 1 : 0; >+} > > # request a ref on a bg_connect and a ref on a scalar > sub connected_bg__raw {
diff --git a/lib/network/tools.pm b/lib/network/tools.pm index 04bd343..8628bc2 100644 --- a/lib/network/tools.pm +++ b/lib/network/tools.pm @@ -47,7 +47,15 @@ sub stop_net_interface { stop_interface($net->{net_interface}, $detach); } -sub connected() { gethostbyname("www.mageia.org") ? 1 : 0 } +sub connected() { + if ($::isInstall) { + # gethostbyname() only reads /etc/resolv.conf once so if resolv.conf is + # not present when the test begins, writing it later is not going to help: + symlink "$::prefix/etc/resolv.conf", "/etc/resolv.conf" if ! -e "/etc/resolv.conf"; + return scalar grep { /1 received/ } `$::prefix/bin/ping -qc1 www.mageia.org`; + } + gethostbyname("www.mageia.org") ? 1 : 0; +} # request a ref on a bg_connect and a ref on a scalar sub connected_bg__raw {
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 5772
:
2196
|
2200
|
2230
|
2235
| 2238 |
2239
|
2303
|
2308
|
2309
|
2310