source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/network/05_network_dom0_ping_pos.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/script
File size: 1.4 KB
Line 
1#!/usr/bin/python
2
3# Copyright (C) International Business Machines Corp., 2005
4# Author:  <dykman@us.ibm.com>
5
6# Ping tests to dom0 interface
7#  - determines dom0 network
8#  - creates a single guest domain
9#  - sets up a single NIC on same subnet as dom0
10#  - conducts ping tests to the dom0 IP address.
11
12# ping -c 1 -s $size $dom0_IP
13#   where $size = 1, 48, 64, 512, 1440, 1500, 1505,
14#                 4096, 4192, 32767, 65507, 65508
15
16pingsizes = [ 1, 48, 64, 512, 1440, 1500, 1505, 4096, 4192,
17                32767, 65507 ]
18
19from XmTestLib import *
20rc = 0
21
22# Test creates 1 domain, which requires 2 ips: 1 for the domains and 1 for
23# aliases on dom0
24if xmtest_netconf.canRunNetTest(2) == False:
25    SKIP("Don't have enough free configured IPs to run this test")
26
27# Fire up a guest domain w/1 nic
28domain = XmTestDomain()
29domain.newDevice(XenNetDevice, "eth0")
30
31try:
32    console = domain.start()
33except DomainError, e:
34    if verbose:
35        print "Failed to create test domain because:"
36        print e.extra
37    FAIL(str(e))
38
39try:
40    # Ping dom0
41    fails=""
42    netdev = domain.getDevice("eth0")
43    dom0ip = netdev.getDom0AliasIP()
44    for size in pingsizes:
45        out = console.runCmd("ping -q -c 1 -s " + str(size) + " " + dom0ip)
46        if out["return"]:
47            fails += " " + str(size)
48except ConsoleError, e:
49        FAIL(str(e))
50
51domain.stop()
52
53if len(fails):
54    FAIL("Ping to dom0 failed for size" + fails + ".")
Note: See TracBrowser for help on using the repository browser.