OvS Plugins Executed Tests

Anuket Project

OvS Plugins Executed Tests

OVS statistic collectd plugin tests.

Test Environment details:

  • Bare Metal,  Ubuntu 16.04.1 LTS

  • Kernel version: 4.4.0-43-generic

Repo/branch used:

  • collectd/master

Tests precondition:

OVS version - 2.5.2.

OpenvSwitch configuration:

  • Start ovs: service openvswitch-switch start

  • Add new bridge: ovs-vsctl add-br br0

  • Allow connection to ovsdb-server: ovs-vsctl set-manager ptcp:6640

Ovs_stat configuration:

  • Open collectd config file: vim /install_folder/etc/collectd.conf

  • Uncomment  LoadPlugin "ovs_stat" fields.

  • Set up IP address, port, bridges (Address/port or OVS DB Socket):

  •  

    • <Plugin ovs_stats> 

    •  

      • Port "6640"

      • Address "127.0.0.1"

      • Socket "/var/run/openvswitch/db.sock"

      • Bridges "br0"

  •           </Plugin>

 Table #1. OVS statistics collectd plugin tests results.

#

Test summary

Steps

Actual result

Expected result

Status - PASS/FAIL

Comments

#

Test summary

Steps

Actual result

Expected result

Status - PASS/FAIL

Comments

1

Verify user can setup simple configuration for ovs_stat plugin.

1. Start collecd deamon : /install_folder/sbin/collectd

2. Navigate to: /tmp/hostname_folder/

3. Check that separate files for all available  interface monitoring statistic are present in folder : ls /ovs_stats-br0.br0

Folder "ovs_stats-br0.br0" was created

Collecd started.
Files in format $monitoring_metrics-YYYY-MM-DD were created

Folder "ovs_stats-br0.br0" was created

Collecd started.
Files in format $monitoring_metrics-YYYY-MM-DD were created

PASS

 

2

Check ovs_stat doesn't collect data when openvswitch is stopped 

1. Stop ovs: service openvswitch-switch stop

2. Start collecd deamon : /install_folder/sbin/collectd

3. Navigate to: /tmp/hostname_folder/

4. Start ovs: service openvswitch-switch start

5.  Navigate to: /tmp/hostname_folder/ovs_stats-br0.br0/

6. Stop ovs: service openvswitch-switch stop

7. Execute command: tail -f /tmp/localhost/ovs_stats-br0.br0/if_packets-YYYY-MM-DD

 

 

Folder "ovs_stats-br0.br0" wasn't created

 

Files in format $monitoring_metrics-YYYY-MM-DD were created

New entry with data doesn't appear

 

 

Folder "ovs_stats-br0.br0" wasn't created

 

Files in format $monitoring_metrics-YYYY-MM-DD were created

New entry with data appears with last collected value

PASS

 

 

3

Verify user configurates ovs_stats with unsupported parameters collectd raise an error 

1. Open collecd.conf file: vim /install_folder/etc/collectd.conf

2. Set up OVS Server field in  ovs_stats  plugin section to $test_data

3. Start collecd deamon : /install_folder/sbin/collectd

4. Verify that collectd doesn't start and error raised. 

test_data = [ "fsdfs"; 1146546, 1.5; $%$]

Error raises for all $test_data and collectd doesn’t start

Error raises for all $test_data and collectd doesn’t start (need to be verified expected behavior)

PASS

 

 

4

Check new data are collected by  ovs_stats with a defined interval

1. Start collecd deamon : /install_folder/sbin/collectd

2. Execute command: tail -f /tmp/localhost/ovs_stats-br0.br0/if_packets-2016-10-26

3. Verify that collected values  were renewed and written every 10 second (default value).

4. Change Interval from 10 to 1 in /install_folder/etc/collectd.conf file

5. Restart collectd: service collectd restart

6. Execute command: tail -f /tmp/localhost/ovs_stats-br0.br0/if_packets-YYYY-MM-DD

7. Verify that collected values  were renewed and written every 1 second.

 

 

 

 

Every 10 second new data writes into file

 

 

 

 

Every 1 second new data writes into file

 

 

 

 

Every 10 second new data writes into file

 

 

 

 

Every 1 second new data writes into file

PASS

 

5

Check if LoadPlugin section  collectd.conf is commented out, warning  message appears 

1. Open collecd.conf file: vim /install_folder/etc/collectd.conf

2. Configure ovs_stats: Comment out #LoadPlugin ovs_stats

3. Start collecd deamon : /install_folder/sbin/collectd

1. Warning message appears: "Loadplugin Found a configuration for the `ovs_stats ' plugin, but the

plugin isn't loaded or didn't register a configuration callback."

2. Collectd have started.

1. Warning message appears: "Loadplugin Found a configuration for the `ovs_stats ' plugin, but the

plugin isn't loaded or didn't register a configuration callback."

2. Collectd have started.

 PASS

 

6

Verify if Address, Port, Bridges configuration is empty in collectd.conf default parameters take place

1. Open collecd.conf file: vim /install_folder/etc/collectd.conf

2. Configure ovs_stats : leave Bridges section blank

3. Start collecd deamon : /install_folder/sbin/collectd

4. Configure ovs_stats : 
leave OVS Address, Port, Bridges section blank

5. Start collecd deamon : /install_folder/sbin/collectd

Collectd started with default parameters.

Collectd started with default parameters.

PASS

 

7

Verify if in ovs_stats section is present extra keyword with value, collectd fails and error message appears

1. Open collecd.conf file: vim /install_folder/etc/collectd.conf

2. Configure ovs_stats : add extra key - value: Interval 1

3. Start collecd deamon : /install_folder/sbin/collectd

1. Message: ovs_stats: option 'Interval' not allowed here

2. ovs_stats and collectd failled

1. Message: ovs_stats: option 'Interval' not allowed here

2. ovs_stats and collectd failled

PASS

 

8

Check if LoadPlugin configutration section  in collectd.conf is commented out, ovs_stats using default configuration values

1. Open collecd.conf file: vim /install_folder/etc/collectd.conf

2. Comment out: 
#<Plugin ovs_stats>
# Adress "127.0.0.1"
#Port "6640"
# Bridges "br0"
#</Plugin>

3. Start collecd deamon : /install_folder/sbin/collectd

4. Check that separate files for all available  interface monitoring statistic are present in folder : ls /ovs_stats-br0.br0

Files in format $monitoring_metrics-YYYY-MM-DD were created. Default values are used for OVS.

monitoring_metrics

if_collisions
if_dropped
if_errors
if_packets
if_rx_errors-crc
if_rx_errors-frame
if_rx_errors-over
if_rx_octets
if_tx_octets

Files in format $monitoring_metrics-YYYY-MM-DD were created. Default values are used for OVS.

monitoring_metrics

if_collisions
if_dropped
if_errors
if_packets
if_rx_errors-crc
if_rx_errors-frame
if_rx_errors-over
if_rx_octets
if_tx_octets

PASS

 

9

Verify that ovs_stats supports complex (more than 1 bridge) configuration

1. Add new openwswitch instance: ovs-vsctl add-br br1

2. Add created switch into ovs_stats configuration section: Brigdes "br0" "br1"

3. Start collecd deamon : /install_folder/sbin/collectd

4. Check that separate folders were created for each bridge in config.

5. Move to each created folder.

Folders:  ovs_stats-br0.br0 , ovs_stats-br1.br1 were created

Files in format $monitoring_metrics-YYYY-MM-DD were created into each folder

Folders:  ovs_stats-br0.br0 , ovs_stats-br1.br1 were created

Files in format $monitoring_metrics-YYYY-MM-DD were created into each folder

PASS

 

10

Check that there are no double entries in data created files 

1. Start collecd deamon : /install_folder/sbin/collectd

2. Execute command:  cat /tmp/hostname_folder/ovs_stats-br0.br0/if_dropped-YYYY-MM-DD

3. Verify that there is only one entry for collected test data per interval.

One entry per time interval

One entry per time interval.

PASS

 

 

11

Verify that ovs_stats collectd data from new bridges (brigde interfaces) when they were added after collectd and ovs_satst have started

1. Start collecd deamon : /install_folder/sbin/collectd

2. Add new bridge: ovs-vsctl add-br new_brigde

3. Navigate to: /tmp/hostname_folder/

4. Check that separate files for all available  interface monitoring statistic are present in folder : ls /ovs_stats-new_bridge.new_bridge

5. Add port to br0: ovs-vsctl add-port br0 test_port1 -- set interface test_port1 type=internal

6. Navigate to: /tmp/hostname_folder/

7. Check that separate files for all available  interface monitoring statistic are present in folder : ls /ovs_stats-br0.test_port1

 

 

Folder "ovs_stats-new_bridge.new_bridge" was created

Files in format $monitoring_metrics-YYYY-MM-DD were created into folder

Folder "ovs_stats-br0.test_port1" was created

 

Files in format $monitoring_metrics-YYYY-MM-DD were created into each folder

 

 

Folder "ovs_stats-new_bridge.new_bridge" was created

Files in format $monitoring_metrics-YYYY-MM-DD were created into folder

Folder "ovs_stats-br0.test_port1" was created

 

Files in format $monitoring_metrics-YYYY-MM-DD were created into each folder

PASS

 

12

Check that ovs_stats collects data from ovsdb. 

1. Start python socket which emulates ovsdb replies. 

2.Start collecd deamon : /install_folder/sbin/collectd

3. Send ovsdb reply with $test_data.

4. Check that sended $test_data was written in appropriate files fro br0.br0 interface: cat /ovs_stats-br0.br0/$monitoring_metrics files

test_data:

if_collisions 50
if_dropped 100
if_errors 125
if_packets 300
if_rx_errors-crc 512
if_rx_errors-frame 345
if_rx_errors-over 800
if_rx_octets 93660
if_tx_octets 45646

$test_data was written into appropriate files  

$test_data was written into appropriate files  

PASS

 

13

Verify plugin stops collecting data for specific bridge when bridge is removed from ovs

1. Start collecd deamon : /install_folder/sbin/collectd

2. Check that ovs_stats collecting data: cat /ovs_stats-br0.br0/$monitoring_metricsfiles

3. Delete ovs: ovs-vsctl del-br br0.

4. Check that ovs_stats stop collecting data: cat /ovs_stats-br0.br0/$monitoring_metrics files

 

New entry with data appears

 

 

New entry with data doesn't appear

 

New entry with data appears

 

 

New entry with data doesn't appear

PASS

 

14

Check plugin stops collecting data for specific port when port is removed from bridge

1. Start collecd deamon : /install_folder/sbin/collectd

2. Add port to br0: ovs-vsctl add-port br0 test_port1 -- set interface test_port1 type=internal

3. Delete port:  ovs-vsctl del-port test_port1

4. Check that ovs_stats stop collecting data: cat /ovs_stats-br0.test_port1/$monitoring_metrics files

 

Folder "ovs_stats-br0.test_port1" was created

 

 

New entry with data doesn't appear

 

Folder "ovs_stats-br0.test_port1" was created

 

 

New entry with data doesn't appear

PASS

 

15

Ovs_stats plugin: overflow stats counter

1. Start python socket which emulates ovsdb replies.

2. Set  if_rx_errors-over value > 2^63

3. Start collecd deamon : /install_folder/sbin/collectd

4. Check handled data.

New entry with value 2^63-1 appears into if_rx_errors-over file. Errors or exceptions weren't raised.

Counter's values should wrap around (max value, zero, one, so on)

New entry with value 2^63-1 appears into if_rx_errors-over file. Errors or exceptions weren't raised.

Counter stuck at max value.

PASS

 

 16

Verify OVS stats IP address field could be set up to work in either IPv4 or IPv6

  1. Set up Interface filed in collectd.conf file to IPv4.
    Configure ovs-manager for listening IPv4.
    Start collectd.

  2. Set up Interface filed in collectd.conf file to IPv6.
    Configure ovs-manager for listening IPv6.
    Start collectd.

  1. New entries are created for ovs_stats files.

  2. New entries are created for ovs_stats files.

  1. New entries are created for ovs_stats files.

  2. New entries are created for ovs_stats files.

PASS 

 

17 

Verify OVS stats updated only for bridges are written to the collectd.conf

  1. Create new OVS bridge. Configure collectd.conf.

  2. Start collectd.

  1. Done.

  2. Collectd is started.
    OVS stats only updated for bridges set in collectd.conf.

  1. Done.

  2. Collectd is started.
    OVS stats only updated for bridges set in collectd.conf.

 PASS

 

 18

Verify OVS stats statistic is updated over socket created by address/port pair 

  1. Stop openvswitch service.

  2. Configure collectd.conf to work via address/port. Start collectd.

  3. Emulate OVS server starting from zero values.

  1. Success.

  2. Success.

  3. OVS stats counters and CSV write plugin data are the same

  1. Success.

  2. Success.

  3. OVS stats counters and CSV write plugin data are the same

 PASS

 

 19

Verify OVS stats statistic Rx packets and bytes counters sent from Ixia and read from CSV plugin.

  1. Add linux ports to OVS bridge. Start collectd.

  2. Configure streams, clear statistic, send packets.

  1. Collect is running.

  2. Verify clear traffic run through OVS. Verify sent packets/bytes and OVS stats values are the same. Verify OVS stats and OVS plugin values (using CSV plugin) are the same.

  1. Collect is running.

  2. Verify clear traffic run through OVS. Verify sent packets/bytes and OVS stats values are the same. Verify OVS stats and OVS plugin values (using CSV plugin) are the same.

 PASS

 

 20

Verify bad CRC packets correct counting by OVS plugin.

  1. Add linux ports to OVS bridge. Start collectd.

  2. Configure bad CRC streams, clear statistic, send packets.

  3. Stop sending packets.

  1. Collectd is running.

  2. Bad CRC counter is being increased.

  3. Verify bad CRC counters sent from Ixia and in OVS stats are the same. Verify bad CRC counters in OVS stats and OVS stats plugin (using CSV plugin) are the same.

  1. Collectd is running.

  2. Bad CRC counter is being increased.

  3. Verify bad CRC counters sent from Ixia and in OVS stats are the same. Verify bad CRC counters in OVS stats and OVS stats plugin (using CSV plugin) are the same.

 PASS

 

21

Verify rx dropped packets correct counting by OVS plugin.