~ubuntu-dev/ubuntu/lucid/atheist/lucid-201002101901

« back to all changes in this revision

Viewing changes to examples/is_google_reachable.test

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2009-09-06 11:56:09 UTC
  • Revision ID: james.westby@ubuntu.com-20090906115609-r4fl7q3n8vmc6s94
Tags: upstream-0.20090906
ImportĀ upstreamĀ versionĀ 0.20090906

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- mode:python; coding:utf-8 -*-
 
2
 
 
3
Test('ip link | grep eth0 | grep "state UP"',
 
4
     desc="interface link up",
 
5
     shell=True)
 
6
 
 
7
Test("ping -c2 $(/sbin/route -n | grep ^0.0.0.0 | awk '{print $2}')",
 
8
     desc="local router reachable",
 
9
     shell=True)
 
10
 
 
11
for line in file('/etc/resolv.conf'):
 
12
    if not line.startswith('nameserver'): continue
 
13
    Test('ping -c 2 %s' % line.split(' ')[1],
 
14
         desc="DNS server reachable")
 
15
 
 
16
Test('host www.google.com',
 
17
     desc="Resolve google website")
 
18
 
 
19
Test('ping -c 1 www.google.com',
 
20
     desc="google reachable")
 
21
 
 
22
Test('wget http://www.google.com/index.html',
 
23
     desc="Download google HTTP index")