Functional test for boot interface detection

Also adds missing documentation.

Change-Id: I6eece4d022d929630be9b7612fdb860a07ee0c5e
Implements: blueprint better-boot-interface-detection
This commit is contained in:
Dmitry Tantsur 2015-02-09 15:34:31 +01:00
parent 96affbc9f6
commit f656333d52
4 changed files with 15 additions and 1 deletions

View File

@ -267,6 +267,9 @@ The HTTP API consist of these endpoints:
* ``local_gb`` hard drive size in GiB
* ``interfaces`` dictionary filled with data from all NIC's, keys being
interface names, values being dictionaries with keys:
* Optional MAC address of the NIC that the machine PXE booted from
either in standard format ``11:22:33:44:55:66`` or in *PXELinux*
``BOOTIF`` format ``01-11-22-33-44-55-66``.
* ``mac`` MAC address
* ``ip`` IP address

View File

@ -1,6 +1,9 @@
if [[ "$1" = "discoverd_callback_url" ]];
then
echo http://127.0.0.1:5050/v1/continue
elif [[ "$1" = "BOOTIF" ]];
then
echo 01-11-22-33-44-55-66
else
echo
fi

8
functest/env/ip vendored
View File

@ -11,3 +11,11 @@ then
echo "2: em2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 66:55:44:33:22:11 brd ff:ff:ff:ff:ff:ff"
fi
if [ "x$3" == "xem3" ];
then
echo "3: em3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 66:55:44:33:22:11 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.16/24 brd 192.168.0.255 scope global dynamic wlp3s0
valid_lft 78195sec preferred_lft 78195sec"
fi

View File

@ -66,7 +66,7 @@ class Test(base.NodeTest):
shutil.copytree(ROOT, self.env)
net_ifaces = os.path.join(self.env, 'net')
os.mkdir(net_ifaces)
for fname in ('lo', 'em1', 'em2'):
for fname in ('lo', 'em1', 'em2', 'em3'):
open(os.path.join(net_ifaces, fname), 'wb').close()
ramdisk_url = os.environ.get('RAMDISK_SOURCE', RAMDISK)