blob: 643c63a93c95be37ac853e50c6cc4be8d3513858 [file] [log] [blame]
Dan Talayco34089522010-02-07 23:07:41 -08001"""
2OpenFlow Test Framework
3
4Configuration fragment
5
6This file contains Python code to specify the configuration
7of the system under test.
8
9This is a work in progress. The code below is for illustration only.
10
11The configuration information is extensible in that any
12Python code may be added to this file (or its imports) and will
13be available to test cases.
14
15A platform identifier is given at the top of the file and most
16other information is determined by testing this value. Additional
17files may also be imported based on the platform.
18
19The configuration must specify a mapping from system interfaces
20available to the test framework to OpenFlow port numbers on the
21switch under test. This is done in the interface_ofport_map
22dictionary. Future extensions may include specifying a driver
23for the port (so as to allow remote packet generation) and to
24specify a switch instance (to allow multiple switches to be
25tested together).
26
27Currently, the assumption is that ports are bidirectional, so
28specifying "OF port 1 is connnected to eth2" implies this is so
29for both TX and RX.
30
31"""
32
33##@var platform
34# A string representing the platform under test. Tested below
35# for determining other variables.
36
37##@var switch_cxn_type
38# How does the test framework communicate to the switch?
39#
40# Options include:
41# @arg localhost: Switch is running on same host as tests
42# @arg ssh: Use paramiko to control ssh connection. Needs switch
43# IP and other params
44#
45# For ssh, additional variables include
46# @arg switch_ip = "192.168.2.21"
47# @arg switch_username = "root"
48# @arg switch_password
49
50##@var switch_init
51# A function to be called to initialize the switch. May be None
52# to indicate no such function needs to be called.
53
54##@var switch_connect
55# Function to be called to prompt the switch to connect to the
56# controller. The function may need to maintain connection state
57# as it could be called multiple times between disconnects.
58
59##@var switch_disconnect
60# Function to be called to force the switch to disconnect from the
61# controller.
62
63##@var controller_ip
64# Gives the controller IP address to use
65
66##@var controller_port
67# Gives the controller port to use
68
69platform = "sw_userspace"
70# platform = "sw_kernelspace"
71# platform = "bcm_indigo"
72# platform = "stanford_lb4g"
73
74if platform == "sw_userspace":
75 interface_ofport_map = {
76 1 : "eth2",
77 2 : "eth3",
78 3 : "eth4",
79 4 : "eth5"
80 }
81 switch_cxn_type = "localhost"
82 switch_init = None # TBD
83 switch_connect = None # TBD
84 switch_disconnect = None # TBD
85 controller_ip = "172.27.74.158"
86 controller_port = 7000
87
88elif platform == "bcm_indigo":
89 switch_cxn_type = "ssh"
90 switch_ip = "192.168.2.21"
91 switch_username = "root"
92 switch_password = "OpenFlow"
93 switch_init = None # TBD
94 switch_connect = None # TBD
95 switch_disconnect = None # TBD
96 controller_ip = "172.27.74.158"
97 controller_port = 7000