summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2011-08-25 08:29:30 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-25 08:51:30 -0700
commit6c2b7beac3cd23ed44bd3e195c6360a0932876bf (patch)
tree95d5774445d635c27a61d88d95d5109d6db45497 /meta/classes/sanity.bbclass
parentc03195482276d7c96d52f21562f8fa6a636f68a7 (diff)
downloadpoky-6c2b7beac3cd23ed44bd3e195c6360a0932876bf.tar.gz
classes/sanity: enhance the network connectivity test
Switch to use the checkstatus fetcher API for the network connectivity test, this has several advantages: * we no longer print any messages to the console whilst the check is being run * we don't actually download anything, removing the need for tidy up and making the code more concise (From OE-Core rev: 81aa4bfbde871af1d569b64499c34a315bf6218e) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass14
1 files changed, 2 insertions, 12 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 16af0293d9..cefe6a483e 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -95,15 +95,9 @@ def check_connectivity(d):
95 network_enabled = not bb.data.getVar('BB_NO_NETWORK', d, True) 95 network_enabled = not bb.data.getVar('BB_NO_NETWORK', d, True)
96 check_enabled = len(test_uris) 96 check_enabled = len(test_uris)
97 if check_enabled and network_enabled: 97 if check_enabled and network_enabled:
98 data = bb.data.createCopy(d)
99 bookmark = os.getcwd()
100 dldir = bb.data.expand('${TMPDIR}/sanity', data)
101 bb.data.setVar('DL_DIR', dldir, data)
102
103 try: 98 try:
104 fetcher = bb.fetch2.Fetch(test_uris, data) 99 fetcher = bb.fetch2.Fetch(test_uris, d)
105 fetcher.download() 100 fetcher.checkstatus()
106 fetcher.clean(test_uris)
107 except Exception: 101 except Exception:
108 # Allow the message to be configured so that users can be 102 # Allow the message to be configured so that users can be
109 # pointed to a support mechanism. 103 # pointed to a support mechanism.
@@ -111,10 +105,6 @@ def check_connectivity(d):
111 if len(msg) == 0: 105 if len(msg) == 0:
112 msg = "Failed to fetch test data from the network. Please ensure your network is configured correctly.\n" 106 msg = "Failed to fetch test data from the network. Please ensure your network is configured correctly.\n"
113 retval = msg 107 retval = msg
114 finally:
115 # Make sure we tidy up the cruft
116 oe.path.remove(dldir)
117 os.chdir(bookmark)
118 108
119 return retval 109 return retval
120 110