commit a17cc7330789e4971e3fdf398c1ceda0cc65f5ad
Author: Radek Pazdera <rpazdera(a)redhat.com>
Date: Thu Mar 14 12:03:29 2013 +0100
recipes: Adding Smoke test recipes
We are breaking quite a few things at the moment (and we plan to keep
doing so for a while), so I decided to develop a small set of smoke
tests we can use while working on these changes.
These tests should cover most of the basic functionality and verify
that the changes didn't break anything crucial.
If you have any more things that should be tested, please, feel free
to add them here!
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
recipes/smoke/generate-recipes.sh | 62 +++++++++++++++++++++++++++++++++++
recipes/smoke/lib/conf-bond.xml | 13 +++++++
recipes/smoke/lib/conf-eth.xml | 7 ++++
recipes/smoke/lib/conf-team.xml | 21 ++++++++++++
recipes/smoke/lib/conf-vlan.xml | 14 ++++++++
recipes/smoke/lib/recipe-temp.xml | 19 +++++++++++
recipes/smoke/lib/req.xml | 14 ++++++++
recipes/smoke/lib/seq-bg.xml | 13 +++++++
recipes/smoke/lib/seq-exec.xml | 7 ++++
recipes/smoke/lib/seq-ping.xml | 10 ++++++
recipes/smoke/lib/seq-sysconfig.xml | 10 ++++++
11 files changed, 190 insertions(+), 0 deletions(-)
---
diff --git a/recipes/smoke/generate-recipes.sh b/recipes/smoke/generate-recipes.sh
new file mode 100755
index 0000000..d9a4e6f
--- /dev/null
+++ b/recipes/smoke/generate-recipes.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# LNST Smoke Tests
+# Author: Radek Pazdera <rpazdera(a)redhat.com>
+# License: GNU GPLv2
+
+# This script will generate a set of recipes for assessing the very basic
+# functionality of LNST.
+
+DIR="tests/"
+LIB="../lib"
+
+echo "[LNST Smoke Tests]"
+
+echo -n "Creating '$DIR' directory for the recipes..."
+mkdir -p $DIR
+cd $DIR
+echo -e "[DONE]"
+
+sequences=""
+for seq in `ls -1 $LIB/seq-*`; do
+ echo "Found command sequence $seq"
+ sequences="$sequences\n <command_sequence
source=\"$seq\"/>"
+done
+
+CONF_FILES=`ls -1 $LIB/conf-*`
+for conf in $CONF_FILES; do
+ echo "Found configuration $conf"
+done
+
+for machine1 in $CONF_FILES; do
+ for machine2 in $CONF_FILES; do
+ name1=`echo -n "$machine1" | head -c -4 | cut -c 13-`
+ name2=`echo -n "$machine2" | head -c -4 | cut -c 13-`
+ recipe_name="recipe-$name1-$name2.xml"
+ echo -ne "Generating $DIR$recipe_name..."
+ cat "$LIB/recipe-temp.xml" | \
+ sed "s|#CONF1#|$machine1|g" | \
+ sed "s|#CONF2#|$machine2|g" | \
+ sed "s|#SEQUENCES#|$sequences|g" > "$recipe_name"
+
+ echo -e "[DONE]"
+ done
+done
+
+echo ""
+
+echo "To run these recipes, you need to have a pool prepared with at"
+echo "least two machines. Both of them must have at least two test"
+echo "interfaces connected to the same network segment."
+
+echo ""
+
+echo " +-----------+ +--------+ +-----------+"
+echo " | |----------| |----------| |"
+echo " | Machine | | Switch | | Machine |"
+echo " | 1 |----------| |----------| 2 |"
+echo " | | +--------+ | |"
+echo " +-----------+ +-----------+"
+
+echo -e "\nYou can execute the set using the following command:"
+echo " ./lnst-ctl -d recipes/smoke/tests/ run"
diff --git a/recipes/smoke/lib/conf-bond.xml b/recipes/smoke/lib/conf-bond.xml
new file mode 100644
index 0000000..7e78719
--- /dev/null
+++ b/recipes/smoke/lib/conf-bond.xml
@@ -0,0 +1,13 @@
+<netconfig>
+ <interface id="if-1" phys_id="dev-1"
type="eth"/>
+ <interface id="if-2" phys_id="dev-2"
type="eth"/>
+ <interface id="testiface" type="bond">
+ <slaves>
+ <slave id="if-1"/>
+ <slave id="if-2"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/smoke/lib/conf-eth.xml b/recipes/smoke/lib/conf-eth.xml
new file mode 100644
index 0000000..6df4cfb
--- /dev/null
+++ b/recipes/smoke/lib/conf-eth.xml
@@ -0,0 +1,7 @@
+<netconfig>
+ <interface id="testiface" phys_id="dev-1"
type="eth">
+ <addresses>
+ <address value="{$testip}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/smoke/lib/conf-team.xml b/recipes/smoke/lib/conf-team.xml
new file mode 100644
index 0000000..05c050a
--- /dev/null
+++ b/recipes/smoke/lib/conf-team.xml
@@ -0,0 +1,21 @@
+<netconfig>
+ <interface id="if-1" phys_id="dev-1"
type="eth"/>
+ <interface id="if-2" phys_id="dev-2"
type="eth"/>
+ <interface id="testiface" type="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "hwaddr": "00:11:22:33:44:55",
+ "runner": {"name": "roundrobin"}
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ <slave id="2"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/smoke/lib/conf-vlan.xml b/recipes/smoke/lib/conf-vlan.xml
new file mode 100644
index 0000000..7b1b657
--- /dev/null
+++ b/recipes/smoke/lib/conf-vlan.xml
@@ -0,0 +1,14 @@
+<netconfig>
+ <interface id="if-1" phys_id="dev-1"
type="eth"/>
+ <interface id="testiface" type="vlan"/>
+ <options>
+ <option name="vlan_tci" value="10"/>
+ </options>
+ <slaves>
+ <slave id="1"/>
+ </slaves>
+ <addresses>
+ <address value="{$testip}"/>
+ </addresses>
+ </interface>
+</netconfig>
diff --git a/recipes/smoke/lib/recipe-temp.xml b/recipes/smoke/lib/recipe-temp.xml
new file mode 100644
index 0000000..2578cca
--- /dev/null
+++ b/recipes/smoke/lib/recipe-temp.xml
@@ -0,0 +1,19 @@
+<lnstrecipe>
+ <machines>
+ <machine id="1">
+ <define>
+ <alias name="testip"
value="192.168.100.240/24"/>
+ </define>
+ <requirements source="../lib/req.xml"/>
+ <netconfig source="#CONF1#"/>
+ </machine>
+ <machine id="2">
+ <define>
+ <alias name="testip"
value="192.168.100.215/24"/>
+ </define>
+ <requirements source="../lib/req.xml"/>
+ <netconfig source="#CONF2#"/>
+ </machine>
+ </machines>
+ #SEQUENCES#
+</lnstrecipe>
diff --git a/recipes/smoke/lib/req.xml b/recipes/smoke/lib/req.xml
new file mode 100644
index 0000000..57a592f
--- /dev/null
+++ b/recipes/smoke/lib/req.xml
@@ -0,0 +1,14 @@
+<requirements>
+ <netdevices>
+ <netdevice network="net" phys_id="dev-1">
+ <params>
+ <param name="type" value="eth"/>
+ </params>
+ </netdevice>
+ <netdevice network="net" phys_id="dev-2">
+ <params>
+ <param name="type" value="eth"/>
+ </params>
+ </netdevice>
+ </netdevices>
+</requirements>
diff --git a/recipes/smoke/lib/seq-bg.xml b/recipes/smoke/lib/seq-bg.xml
new file mode 100644
index 0000000..302a9f4
--- /dev/null
+++ b/recipes/smoke/lib/seq-bg.xml
@@ -0,0 +1,13 @@
+<command_sequence>
+ <command machine_id="1" timeout="30" type="test"
+ value="IcmpPing" bg_id="1">
+ <options>
+ <option name="addr" value="{ip(2,testiface)}"/>
+ <option name="count" value="40"/>
+ <option name="interval" value="0.2"/>
+ <option name="limit_rate" value="95"/>
+ </options>
+ </command>
+ <command type="ctl_wait" value="5"/>
+ <command machine_id="1" timeout="30" type="intr"
value="1"/>
+</command_sequence>
diff --git a/recipes/smoke/lib/seq-exec.xml b/recipes/smoke/lib/seq-exec.xml
new file mode 100644
index 0000000..9cd014e
--- /dev/null
+++ b/recipes/smoke/lib/seq-exec.xml
@@ -0,0 +1,7 @@
+<command_sequence>
+ <command machine_id="1" timeout="30" type="exec"
+ value="[ `ip -o link | grep {devname(1,testiface)} | wc -l` -gt 0
]"/>
+ <!-- This does not yet work for non-eth devices -->
+ <!--<command machine_id="1" timeout="30"
type="exec"
+ value="[ `ip -o link | grep {hwaddr(1,testiface)} | wc -l` -gt 0
]"/>-->
+</command_sequence>
diff --git a/recipes/smoke/lib/seq-ping.xml b/recipes/smoke/lib/seq-ping.xml
new file mode 100644
index 0000000..27dd032
--- /dev/null
+++ b/recipes/smoke/lib/seq-ping.xml
@@ -0,0 +1,10 @@
+<command_sequence>
+ <command machine_id="1" timeout="30" type="test"
value="IcmpPing">
+ <options>
+ <option name="addr" value="{ip(2,testiface)}"/>
+ <option name="count" value="40"/>
+ <option name="interval" value="0.2"/>
+ <option name="limit_rate" value="95"/>
+ </options>
+ </command>
+</command_sequence>
diff --git a/recipes/smoke/lib/seq-sysconfig.xml b/recipes/smoke/lib/seq-sysconfig.xml
new file mode 100644
index 0000000..f901b7b
--- /dev/null
+++ b/recipes/smoke/lib/seq-sysconfig.xml
@@ -0,0 +1,10 @@
+<command_sequence>
+ <command machine_id="1" type="system_config">
+ <options>
+ <option name="/proc/sys/net/ipv4/igmp_max_memberships"
value="5"/>
+ <option name="/proc/sys/net/ipv4/igmp_max_memberships"
value="6"/>
+ <option name="/proc/sys/net/ipv4/igmp_max_memberships"
value="7"/>
+ <option name="/proc/sys/net/ipv4/igmp_max_memberships"
value="8"/>
+ </options>
+ </command>
+</command_sequence>
Show replies by date