Anuket Project

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
1Verify 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 
2Check 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

 

 
3Verify 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 startError raises for all $test_data and collectd doesn’t start (need to be verified expected behavior)

PASS

 

 
4Check 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 
5Check 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 
6Verify 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 
7Verify 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 
8Check 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 
9Verify 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 
10Check 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 intervalOne entry per time interval.

PASS

 

 
11Verify 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 
12Check 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 
14Check 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 
15Ovs_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 
 16Verify 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 
 18Verify 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 
 19Verify 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 
 20Verify 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 
21Verify rx dropped packets correct counting by OVS plugin.
  1. Add linux ports to OVS bridge. Start collectd.
  2. Configure bad CRC streams, clear statistic, send packets with 100% rate (10Gb).
  3. Stop sending packets.
  1. Collectd is running.
  2. Packets got dropped.
  3. Verify rx dropped counters in OVS stats and OVS stats plugin (using CSV plugin) are the same.
  1. Collectd is running.
  2. Packets got dropped.
  3. Verify rx dropped counters in OVS stats and OVS stats plugin (using CSV plugin) are the same.
 PASS 

 

OVS events 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:

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_events configuration:

  • Open collectd config file: vim /install_folder/etc/collectd.conf
  • Uncomment LoadPlugin "ovs_events" fields.
  • Set up Port "6640", Address "127.0.0.1", Interfaces "br0"

Ovs_events configuration:

  • Open collectd config file: vim /install_folder/etc/collectd.conf
  • Uncomment LoadPlugin "ovs_events" fields.
  • Set up Port "6640", Address "127.0.0.1", Interfaces "br0"

Exec plugin configuration:

  • Create non root user (example "test") and put bash file: 

    #!/bin/bash
    rm -f /tmp/notifications
    while read x y
    do
    echo $x$y >> /tmp/notifications
    done

  • Open collectd config file: vim /install_folder/etc/collectd.conf
  • Configure exec plugin: <LoadPlugin exec> 
    <Plugin exec> 
    Exec "user_name:user_group" "path_to_bash_script" 
    NotificationExec "user_name:user_group" "path_to_bash_script" 
    </Plugin>

Syslog plugin configuration:

  • Configure:

    <Plugin syslog>
    LogLevel debug
    NotifyLevel "OKAY"
    </Plugin>

Table #2. OVS events collectd plugin tests results.

#

Test summary

Steps
Actual result
Expected result
Status - PASS/FAIL
Comments
1Verify user can setup simple configuration for ovs_events  plugin.

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

2. Navigate to: /tmp/hostname_folder/

3. Check that file with link status was created: ls /ovs_events-br0

Folder "ovs_events-br0" was created.

File in format "gauge-link_status-YYYY-MM-DD" was created

Folder "ovs_events-br0" was created.

File in format "gauge-link_status-YYYY-MM-DD" was created

PASS 
2Check ovs_events 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_events-br0/

6. Stop ovs: service openvswitch-switch stop

7.  Execute command: tail -f /tmp/localhost/ovs_events-br0/gauge-link_status-YYYY-MM-DD

 

 

Folder "ovs_events-br0" wasn't created

 

File in format "gauge-link_status-YYYY-MM-DD" was created

New entry with data appears with last collected value

 

 

Folder "ovs_events-br0" wasn't created

 

File in format "gauge-link_status-YYYY-MM-DD" was created

New entry with data appears with last collected value

PASS 
3Check new data are collected by  ovs_events with a defined interval

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

2. Execute command: tail -f /tmp/localhost/ovs_events-br0/gauge-link_status-YYYY-MM-DD

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_events-br0/gauge-link_status-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 
4Check if Plugin configutration section  in collectd.conf is commented out, ovs_events using default configuration values

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

2. Comment out: 
#<Plugin ovs_events>
# Port "6640"
# Address "127.0.0.1"
# Socket "/var/run/openvswitch/db.sock"
# Interfaces "br0"
# SendNotification false
#</Plugin>

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

4. Check that file for interface is present in folder : ls /ovs_events-br0

 

 

default values
Port "6640"
Address "localhost"
Interfaces empty
SendNotification false

 

 

File in format "gauge-link_status-YYYY-MM-DD" was created

 

 

default values
Port "6640"
Address "localhost"
Interfaces empty
SendNotification false

 

 

File in format "gauge-link_status-YYYY-MM-DD" was created

PASS 
5Verify that ovs_events supports complex (more than 1 bridge) configuration

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

2. Add created switch into ovs_events 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_events-br0, ovs_events-br1 were created

File in format "gauge-link_status-YYYY-MM-DD" was created for each folder

 

 

 

Folders:  ovs_events-br0, ovs_events-br1 were created

File in format "gauge-link_status-YYYY-MM-DD" was created for each folder

 PASS 
6Check 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_events-br0/gauge-link_status-YYYY-MM-DD

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

One entry per time interval

One entry per time interval

PASS 
7Verify that ovs_events collectd data from new bridges (brigde interfaces) when they were added after collectd and ovs_eventst 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 file with link status was created: ls /ovs_events-new_brigde

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 file with link status was created: ls /ovs_events-test_port1

Folder "ovs_events-new_bridge" was created

File in format "gauge-link_status-YYYY-MM-DD" was create

Folder "ovs_events-test_port1" was created

File in format "gauge-link_status-YYYY-MM-DD" was created

Folder "ovs_events-new_bridge" was created

File in format "gauge-link_status-YYYY-MM-DD" was create

Folder "ovs_events-test_port1" was created

File in format "gauge-link_status-YYYY-MM-DD" was created

PASS 
8Check that ovs_events collect data from ovsdb

1. Start python socket which emulates ovsdb replies. 

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

3. Send ovsdb reply with "link_state":"up".

4. Check that sended $test_data was written in appropriate files fro br0 interface: cat /ovs_events-br0/gauge-link_status-YYYY-MM-DD

 

 

 

Link status was changed from 0 to 1 

 

 

 

Link status was changed from 0 to 1 

PASS 
9Verify 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_events collecting data: cat /ovs_events-br0/gauge-link_status-YYYY-MM-DD

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

4. Check that ovs_events stop collecting data: cat /ovs_events-br0/gauge-link_status-YYYY-MM-DD

 

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 
10Check 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_events stop collecting data: cat /ovs_events-br0.test_port1/gauge-link_status-YYYY-MM-DD

 

Folder "ovs_events-test_port1" was created

 

New entry with data doesn't appear

 

Folder "ovs_events-test_port1" was created

 

New entry with data doesn't appear

PASS 
11Verify that user can set up into Address : network hostname, IPv4 numbers-and-dots notation or IPv6 hexadecimal string format 

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

2. Check that ovs_events collecting data: cat /ovs_events-br0.test_port1/gauge-link_status-YYYY-MM-DD

3. Set up Address "$hostname", where hostname is name of linux machine (ex: silpixa00397261)

4. Restart collectd: service collectd restart

5. Check that ovs_events collecting data: cat /ovs_events-br0.test_port1/gauge-link_status-YYYY-MM-DD

6. Allow connection to ovsdb-server using ipv6: ovs-vsctl set-manager ptcp:6640:[::1]

7. Set up Address "::"

8. Restart collectd: service collectd restart

9. Check that ovs_events collecting data: cat /ovs_events-br0.test_port1/gauge-link_status-YYYY-MM-DD

New entry with data appears

New entry with data appears

PASS 
12Check if Socket path is set, Address and Port options are ignored

1. Set up Address "192.168.0.1", Port "8956" and Socket "/var/run/openvswitch/db.sock"

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

3. Check that ovs_events collecting data: cat /ovs_events-br0.test_port1/gauge-link_status-YYYY-MM-DD

Set up for Address and Port was ignored and ovs_events using Socket options.

New entry with data appears

Set up for Address and Port was ignored and ovs_events using Socket options.
 

New entry with data appears

PASS 

13

Verify if SendNotification disabled ovs_events doesn’t send any notifications

1. Set up SendNotification false.

2. Set up NotifyLevel OKAY for syslog plugin.

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

4. Run command: tail -f /var/log/syslog

5. Enable br0 intarface: ifconfig br0 up

 

 

 

Notification message does't appear into syslog file

 

 

 

Notification message does't appear into syslog file

PASS 
14

Check if SendNotification enabled ovs_events send notifications when 
- ovs interface (bridge) link status is changed
- ?onnection to OVS database (ovsdb-server daemon) has been lost.

1. Set up SendNotification true.

2. Set up NotifyLevel OKAY for syslog plugin.

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

4. Run command: tail -f /var/log/syslog

5. Enable br0 intarface: ifconfig br0 up

6. Stop ovs: service openvswitch-switch stop

 

 

 

Notification message about link status appears into syslog file

Notification message about ovsdb connection appears into syslog file

 

 

 

Notification message about link status appears into syslog file

Notification message about ovsdb connection appears into syslog file

PASS 
15Check if "Interface" is commented out all available interfaces are monitored

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

2. Comment out #Interfaces and set SendNotification true

3. Enable exec plugin.

4. Run command: tail -f /var/log/syslog

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

6. Check that ovs_events collecting link status and metadata for br0 and br1 : cat path_to_exec_write_file.

Notification message about link status appears into syslog file for br0 and br1 interfaces

Uuid and vm-uuid are present in meta field

New entry with data appears

Notification message about link status appears into syslog file for br0 and br1 interfaces

Uuid and vm-uuid are present in meta field

New entry with data appears

PASS 
16Verify that only specified interface names in Interface field are monitored by ovs_events plugin

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

2. Set Interface "br0"

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

4. Check that ovs_events collecting link status and metadata only for br0 :cat path_to_exec_write_file.

5. Add port br1 into Interface section.

6. Restart collectd.

7. Check that ovs_events collecting link status and metadata for br0 and br1 : cat path_to_exec_write_file.

Uuid and vm-uuid are present in meta field

New entry with data appears
Folder/file for br1 weren't created

 

 

Uuid and vm-uuid are present in meta field
New entry with data appears

Uuid and vm-uuid are present in meta field

New entry with data appears
Folder/file for br1 weren't created

 

 

Uuid and vm-uuid are present in meta field
New entry with data appears

PASS 
17Check that metadata are present when notification raises

1. Set SendNotification true.

2. Enable exec plugin for handling metadata.

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

4. Execute: ifconfig br0 up

5. Check that notification raises. 

6. Verify matadata collected by exec.
Execute: ovs-vsctl list interface br0

 

 

 

Notification message about link status appears into syslog file  br0 interfaces

_uuid = uuid collected by exec, vm-uuid = vm_uuid collected by exec

 

 

 

Notification message about link status appears into syslog file  br0 interfaces

_uuid = uuid collected by exec, vm-uuid = vm_uuid collected by exec

 PASS 
18Verify that ovs_events collecting data from ovs patch interfaces

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

2. Add patch interfaces to br0 and br1:

ovs-vsctl add-port br0 test_1 – set Interface test_1 type=patch options:peer=test_2

ovs-vsctl add-port br1 test_2 – set Interface test_2 type=patch options:peer=test_1

3. Add br1, test_1, test2 to collectd.conf

4. Start collecd deamon : /install_folder/sbin/collect

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

6. Move to each created folder.

 

 

 

 

 

Folders:  ovs_events-br0, ovs_events-br1, ovs_events-test1, ovs_events - test_2 were created

File in format "gauge-link_status-YYYY-MM-DD" was created for each folder

 

 

 

 

 

Folders:  ovs_events-br0, ovs_events-br1, ovs_events-test1, ovs_events - test_2 were created

File in format "gauge-link_status-YYYY-MM-DD" was created for each folder

PASS 
19Check ovs_events handle data from ovs dpdk interfaces

1. Configure ovs with dpdk (https://github.com/jrfastab/OVS/blob/master/INSTALL.DPDK.md)

2. Add 2 dpdk ports into ovs.

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

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

5. Move to each created folder.

 

 

Folders:  ovs_events-br0, ovs_events-dpdk0, ovs_events-dpdk1 were created

File in format "gauge-link_status-YYYY-MM-DD" was created for each folder

 

 

Folders:  ovs_events-br0, ovs_events-dpdk0, ovs_events-dpdk1 were created

File in format "gauge-link_status-YYYY-MM-DD" was created for each folder

PASS 
20Verify if DispatchValues disabled ovs_events does not handle data about link status

1. Set up DispatchValues false.

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

3. Check that link status from ovsdb does not handle.

4. Set up DispatchValues true.

5. Restart collectd: service collectd restart

 

 

Data about link status does't collect

 

Data about link status collected

 

 

Data about link status does't collect

 

Data about link status collected

PASS 
21Check ovs_events handle data about link status and events from 30 openvswitch bridges

1. Add 30 ovs-bridges.

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

3. Check that link status from ovsdb handle by ovs_events.

4. Change link status to up.

 

 

Link status for all 30 bridges was handled

Link status for all 30 bridges was changed to "Up"

30 events appeared in syslog

 

 

Link status for all 30 bridges was handled

Link status for all 30 bridges was changed to "Up"

30 events appeared in syslog

 PASS 
22Verify ovs_events handle data about link status every 0.005 sec

1. Set Interval = 0.005

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

3. Check that link status from ovsdb handle by ovs_events every 0.005 sec.

 

 

Data about link status appears every 0.005 sec

 

 

Data about link status appears every 0.005 sec

 PASS 
23

Verify ovs_events does not handle data when invalid socket path is set

1. Set up Socket to invalid link "/var/test/openvswitch/db.sock"

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

 

Folders and file for ovs_events were not created

Collectd have started

 

Folders and file for ovs_events were not created

Collectd have started

 PASS 
24Verify ovs_events event time less or equal to 0.005 seconds

1. Add linux port to ovs

2. Change port status to UP

3. Compare result from kernel log and raised event.

4. Set up port status DOWN

5. Compare result from kernel log and raised event.

 

 

Event raised time less or equal 0.005 sec

Event raised time less or equal 0.005 sec

 

 

Event raised time less or equal 0.005 sec

Event raised time less or equal 0.005 sec

PASSevent time ~ 0.001-0.002 sec
25Verify that ovs_events handle data from virtual function interfaces

1. Create max VF for interfaces with 'i40e' and 'ixgbe'

2. Change port status to UP

3. Set up port status DOWN

 

Port status for selected VM changed to 1

Port status for selected VM changed to 0

 

Port status for selected VM changed to 1

Port status for selected VM changed to 0
PASS 
26Check if NotifyInterfaceAdd set to False notification message after port/interface added didn't appear

1. Add new port to ovs bridge: ovs-vsctl add-port br0 test_port

2. Using exec plugin handle notification.

3. Remove test_port from ovs.

4. Set NotifyInterfaceAdd false.

5. Restart collectd: service collectd restart

 

Notification message with test_port state changed to "DOWN" appears

 

Notification message didn't appear

 

Notification message with test_port state changed to "DOWN" appears

 

Notification message didn't appear

 PASS 

 

OVS statistic SNMP tests.

Important:

OvS stats can be read directly from OvS using standard SNMP MIBs (IF_MIB) and this does not require OvS plugin availability.

Tests precondition:

  1. SNMP installed and configured.
  2. OvS installed and running.
  3. Standard SNMP MIBS are installed.
  4. Important NOTE: No need in OvS plugin.

Useful information:

  1. IF-MIB starting OID

     .1.3.6.1.2.1.2

  2. Reading list of interfaces from Standard IF_MIB
    snmpwalk -v2c -cpublic localhost .1.3.6.1.2.1.2.2.1.2

  3. Actual OID for OvS interfaces will be stable during current system run, but will differs between different system runs. For example:
    ....................................................................

    iso.3.6.1.2.1.2.2.1.2.311 = STRING: "br0"
    iso.3.6.1.2.1.2.2.1.2.314 = STRING: "test_port1"

  4. List of Counters means simple counters, not detailed.
    For example:

    iso.3.6.1.2.1.2.2.1.10.311 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.11.311 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.12.311 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.13.311 = Counter32: 6524
    iso.3.6.1.2.1.2.2.1.14.311 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.15.311 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.16.311 = Counter32: 6025
    iso.3.6.1.2.1.2.2.1.17.311 = Counter32: 48
    iso.3.6.1.2.1.2.2.1.18.311 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.19.311 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.20.311 = Counter32: 0

 

Table #3. SNMP: OVS statistic tests results.

#
Test case title
Priority 
Steps
Expected result
Actual result
Status
Comments
1Verify that SNMP wlil return all interfaces including OvS interfaces by SNMPWALK standard IF_MIBHigh
  1. Read list of interfaces from IF_MIB
  2. Start OvS and add an interfaces to it
  3. Read list of interfaces from IF_MIB

OvS interfaces are available in output

OvS interfaces are available in outputPASS 
2Verify that SNMP can GET interface info of OvS interfaces from standard IF_MIBHigh
  1.  Start OvS, add interfaces
  2. Find interfaces number in IF_MIB
  3. Get Interface name
  4. Get interface counters

Interface name, counters can be get by appropriate OID number

Interface name, counters returned by appropriate OID numberPASS 
3Verify that reading SNMP value using GETNEXT behaves correctlyHigh
  1. Start OvS, add interfaces
  2. Try GetNext on previous OID
  3. Try GetNext on interface\s OID

Value next after specified is returned

Value next after specified is returnedPASS 
4Verify that SET doesn't work on counters.High
  1. Start OvS, add interfaces
  2. Try to set counter's value for interface

Attempt failed with correct error message

Attempt failedPASS 
5Verify that counters can be read if multiple OvS interfaces are availableHigh
  1. Start OvS , add multiply interfaces
  2. Try get info for different interfaces
Appropriate values for expected interface is returnedAppropriate values for expected interface is returnedPASS 

 

OVS events multi instance collectd plugin tests.

Ovs_events configuration:

  • Open collectd config file: vim /install_folder/etc/collectd.conf
  • Uncomment LoadPlugin "ovs_events" fields.
  • Uncomment 

    <Plugin ovs_events>
    <Instance hostname>
    DispatchValues true
    </Instance>
    SendNotification true
    </Plugin>

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

Table #4. OVS events multi instance collectd plugin tests results.

#

Test summary

Steps
Actual result
Expected result
Status - PASS/FAIL
Comments
1Verify user can setup simple configuration of ovs_events for DUT

1. Start collectd daemon : /install_folder/sbin/collectd

2. Navigate to: /tmp/hostname_folder/

3. Check that file with link status was created: ls /ovs_events-br0

Folder "ovs_events-br0" was created.

 

File in format "gauge-link_status-YYYY-MM-DD" was created

Folder "ovs_events-br0" was created.

 

File in format "gauge-link_status-YYYY-MM-DD" was created

PASS 
2Check ovs_events handle data from remote DUT

1. Add Address = "address of remote DUT"

2. On remote DUT add ovs bridge br0.

3. Start collectd daemon : /install_folder/sbin/collectd

4. Navigate to: /tmp/hostname_folder/

5. Check that file with link status was created: ls /ovs_events-br0

6. Change link status of br0 to UP.

 

 

Folder "ovs_events-br0" was created

 

File in format "gauge-link_status-YYYY-MM-DD" was created

New entry with data appears with last collected

value 1

 

 

Folder "ovs_events-br0" was created

 

File in format "gauge-link_status-YYYY-MM-DD" was created

New entry with data appears with last collected

value 1

PASS 
3Verify user can setup multi instance configuration for ovs_events plugin

1. Add new instance for remote DUT:

<Instance remote_host>
DispatchValues true
Address "remote IP" 
</Instance>

2. On remote DUT add ovs bridge br0.

3. Start collectd daemon : /install_folder/sbin/collectd

4. Navigate to: /tmp/hostname_folder/

5. Change link status of br0 on DUT and remote DUT to UP.

 

 

 

 

 

 

Folders with appropriate files in /tmp/hostname_folder/

and /tmp/remote_host were created

New entry with data appears with last collected value 1 for local and remote DUT

 

 

 

 

 

Folders with appropriate files in /tmp/hostname_folder/

 and /tmp/remote_host were created

New entry with data appears with last collected value 1 for local and remote DUT

PASS 
4Check ovs_events plugin multi instance configuration handle notification events

1. Add new instance for remote DUT:

<Instance remote_host>
DispatchValues true
Address "remote IP" 
</Instance>

2. On remote DUT add ovs bridge br0.

3. Start collectd daemon : /install_folder/sbin/collectd

4. Change link status of br0 on DUT to UP.

5. Using exec plugin handle notification.

6. Change link status of br0 on remote DUT to UP.

 

 

 

 

 

 

 

Notification message with data from local DUT appears

 

Notification message with data from remote DUT appears

 

 

 

 

 

 

 

Notification message with data from local DUT appears

 

Notification message with data from remote DUT appears

PASS 
5Verify user can not create duplicate instances for ovs_events plugin

1. Add new instance for remote DUT same as local DUT:

<Instance hostname>
DispatchValues true
Address "remote IP" 
</Instance>

2. Start collectd daemon : /install_folder/sbin/collectd

 

 

 

 

 

Error message appears in syslog. Collectd does not start

 

 

 

 

 

Error message appears in syslog. Collectd does not start

 PASS 
6

Check user can setup multi instance configuration for

30 ovs instances for ovs_events plugin

1. Add 30 ovs docker containers.

2. Add ovs bridge and port to each container.

3. Add new instances in collectd conf:

<Instance docker_host_0>
DispatchValues true
Port XXXX
</Instance>

<Instance docker_host_29>
DispatchValues true
Port XXXY
</Instance>

4. Start collectd daemon : /install_folder/sbin/collectd

5. Change link status of interface on all ovs instances UP.

6. Using exec plugin handle notification.

 

 

 

 

 

 

 

 

Folders with appropriate files in /tmp/docker_folder/

for each instance were created

New entry with data appears with last collected value 0 for all ovs instances

New entry with data appears with last collected value 1 for all ovs instances

Notification message with data from each instance appears

 

 

 

 

 

 

 

 

Folders with appropriate files in /tmp/docker_folder/

for each instance were created

New entry with data appears with last collected value 0 for all ovs instances

New entry with data appears with last collected value 1 for all ovs instances

Notification message with data from each instance appears

 PASS 
7Verify ovs_events handle data about link status every 0.005 sec

1. Set Interval = 0.005

2. Add new instance for remote DUT:

<Instance remote_host>
DispatchValues true
Address "remote IP" 
</Instance>

3. Start collectd daemon : /install_folder/sbin/collect.

4. Check that link status from ovsdb handle by ovs_events every 0.005 sec.

 

 

 

 

 

 

 

Data about link status appears every 0.005 sec

 

 

 

 

 

 

 

Data about link status appears every 0.005 sec

 PASS 
8Check ovs_events plugin multi instance default configuration

1. Comment Plugin ovs_events section in collectd.conf.

2. Start collectd daemon : /install_folder/sbin/collect.

3. Change link status of br0 on DUT to UP.

4. Using exec plugin handle notification.

 

 

 

 

Notification message with data from local DUT appears

Data about link status didn't handle by ovs_evets plugin

 

 

 

 

Notification message with data from local DUT appears

Data about link status didn't handle by ovs_evets plugin

 PASS 
9

Verify ovs_events handle data about link status

from 12 instances with 1 VF and 4 local port into each instance

1. Create 12 VF from active interface.

2. Add VFs to ovs-instances and 4 local port.

3. Add new instances to collectd plugin:

<Instance remote_host>
DispatchValues true
Port "XXXX"
</Instance>

4. Start collectd daemon : /install_folder/sbin/collect.

5. Check that link status from ovsdb handle by ovs_events every 0.005 sec.

6. Change link status of interface on all ovs instances UP.

7. Using exec plugin handle notification.

 

 

 

 

Folders with appropriate files in /tmp/docker_folder/

for each instance were created

New entry with data appears with last collected value 0 for all ovs instances

Data about link status appears every 0.005 sec

 

New entry with data appears with last collected value 1 for all ovs instances

Notification message with data from each instance appears

 

 

 

 

Folders with appropriate files in /tmp/docker_folder/

for each instance were created

New entry with data appears with last collected value 0 for all ovs instances

Data about link status appears every 0.005 sec

 

New entry with data appears with last collected value 1 for all ovs instances

Notification message with data from each instance appears

 PASS 
10Check ovs_events plugin multi instance with physical interfaces

1. Get names of available NIC (except management interface).

2. Add 1 NIC port 4 local (internal) ovs ports to ovs-instance.

3. Add new instances to collectd plugin:

<Instance remote_host>
DispatchValues true
Port "XXXX"
</Instance>

4. Start collectd daemon: /install_folder/sbin/collect.

5. Check that link status from ovsdb handle by ovs_events every 0.005 sec.

6. Change link status of interface on all ovs instances UP.

7. Using exec plugin handle notification.

 

 

 

 

Folders with appropriate files in /tmp/docker_folder/

for each instance were created

New entry with data appears with last collected value 0 for all ovs instances

Data about link status appears every 0.005 sec

 

New entry with data appears with last collected value 1 for all ovs instances

Notification message with data from each instance appears

 

 

 

 

Folders with appropriate files in /tmp/docker_folder/

for each instance were created

New entry with data appears with last collected value 0 for all ovs instances

Data about link status appears every 0.005 sec

 

New entry with data appears with last collected value 1 for all ovs instances

Notification message with data from each instance appears

PASS 
11Check ovs_events plugin multi instance start/stop ovs instance

1. Add 10 ovs containers.

2. Add ovs bridge and port to each container.

3. Add new instances in collectd conf:

<Instance docker_host_0>
DispatchValues true
Port XXXX
</Instance>

<Instance docker_host_9>
DispatchValues true
Port XXXY
</Instance>

4. Start collectd daemon : /install_folder/sbin/collectd

5. Change link status of interface on all ovs instances UP.

6. Stop 5 ovs containers.

7. Start 5 ovs containers.

 

 

 

 

 

 

 

 

 

 

 

New entry with data appears with last collected value 1 for all ovs instances

ovs_events stop collecting data from stopped ovs instances

ovs_events collecting data from started ovs instances

 

 

 

 

 

 

 

 

 

 

 

 

New entry with data appears with last collected value 1 for all ovs instances

ovs_events stop collecting data from stopped ovs instances

ovs_events collecting data from started ovs instances

 PASS 

OVS stats multi instance collectd plugin tests.

Ovs_stats configuration:

  • Open collectd config file: vim /install_folder/etc/collectd.conf
  • Uncomment LoadPlugin "ovs_stats" fields.
  • Uncomment 

    <Plugin ovs_stats>
    <Instance hostname>
    </Instance>
    </Plugin>

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

Table #5. OVS stats multi instance collectd plugin tests results.

#

Test summary

Steps
Actual result
Expected result
Status - PASS/FAIL
Comments
1Verify ovs_stats when extra keyword present in collectd.conf

1. Configure ovs_stats section and add extra values:
<Plugin ovs_stats>
<Instance hostname>
Port "6640"
Address "127.0.0.1"
DispatchValue true
</Instance>
</Plugin>

2. Start collectd

 

 

 

 

 

 

Collectd crashes after start

 

PASS

 

 
2Verify user can setup multi instance configuration for ovs_stats plugin

1. Add new instance for remote DUT:

<Instance remote_host>
Address "remote IP" 
</Instance>

2. On remote DUT add ovs bridge br0.

3. Start collectd daemon : /install_folder/sbin/collectd

4. Navigate to: /tmp/hostname_folder/

5. Change link status of br0 on DUT and remote DUT to UP.

 

 

 

 

 

 

Folders with appropriate files in /tmp/hostname_folder/

and /tmp/remote_host were created

New entry with data appears with last collected value 1 for local and remote DUT

 

 

 

 

 

Folders with appropriate files in /tmp/hostname_folder/

 and /tmp/remote_host were created

New entry with data appears with last collected value 1 for local and remote DUT

PASS

 

 
3Verify user can not create duplicate instances for ovs_stats plugin

1. Add new instance for remote DUT same as local DUT:

<Instance hostname>
Address "remote IP" 
</Instance>

2. Start collectd daemon : /install_folder/sbin/collectd

 

 

 

 

 

Error message appears in syslog. Collectd does not start

 

 

 

 

 

Error message appears in syslog. Collectd does not start

 PASS 
4Check ovs_stats plugin multi instance default configuration

1. Comment Plugin ovs_stats section in collectd.conf.

2. Start collectd daemon : /install_folder/sbin/collect.

 

 

Plugin start handling data from available ovs_instance. Collectd started

 

 

Plugin start handling data from available ovs_instance. Collectd started

 PASS 
5Verify ovs_stats handle data from ovs-dpdk ports

1. Add dpdk port to open virtual bridge.

2. Start collectd daemon : /install_folder/sbin/collect.

 

 

Plugin start handling data from dpdk port. Files for all available dpdk statistics are present.

 

 

Plugin start handling data from dpdk port. Files for all available dpdk statistics are present.

PASSOvS Stats Plugin
6Check that ovs_stats handle data after openvswitchd stop/start/restart

1. Stop openvswitchd: systemctl stop openvswitch-switch.service.

2. Start openvswitch: systemctl start openvswitch-switch.service.

3.Restart openvswitch: systemctl restart openvswitch-switch.service.

Ovs-stats plugin stop collecting data from stopped ovsswitchd.

 

Ovs-stats plugin start collecting data after time Interval.

Ovs-stats plugin stop and than start collecting data after time Interval.

 Ovs-stats plugin stop collecting data from stopped ovsswitchd.

 

Ovs-stats plugin start collecting data after time Interval.

Ovs-stats plugin stop and than start collecting data after time Interval.

 PASS 
7

Verify ovs_stats plugin monitors 20 ovs-instances with

50 ovs-internal ports each

1. Create 20 ovs instances (separate docker containers with ovs).

2. Add 50 ports to each ovs instance.

3. Start collectd.

 

 

Folders with appropriate files were created for each ovs instance and for all 50 internal ports

 

 

Folders with appropriate files were created for each ovs instance and for all 50 internal ports

PASS 



  • No labels