Difference between revisions of "Plugin:capabilities/tests"

From collectd Wiki
Jump to: navigation, search
(Add testplan for capabilities plugin)
 
(Update capabilities testplan page with additional tests)
 
Line 2: Line 2:
  
 
== OPNFV/Barometer ==
 
== OPNFV/Barometer ==
=== Check collectd installation procedure with capabilities enabled ===
+
 
* Test steps
+
{|class="wikitable"
 +
! #
 +
! Description
 +
! Test steps
 +
! Expected result
 +
|-
 +
| 1
 +
| Check collectd installation procedure with capabilities enabled
 +
|
 
# Build and install collectd with debug log level and capabilities plugin enabled
 
# Build and install collectd with debug log level and capabilities plugin enabled
 
# start collectd
 
# start collectd
* Expected result
+
|
** Collectd has started
+
* Collectd has started
** Capabilities plugin is loaded
+
* Capabilities plugin is loaded
 
+
|-
=== Check if the plugin returns the data according to the design ===
+
| 2
* Test steps
+
| Check if the plugin returns the data according to the design
 +
|
 
# Build and install collectd with debug log level and capabilities plugin enabled.  
 
# Build and install collectd with debug log level and capabilities plugin enabled.  
 
# Start collectd
 
# Start collectd
 
# Read the data collectd by plugin
 
# Read the data collectd by plugin
 
     $ curl localhost:9104
 
     $ curl localhost:9104
* Expected result
+
|
** HTTP GET request should result in the display of a data structure about system capabilities read from <code>dmidecode</code>
+
* HTTP GET request should result in the display of a data structure about system capabilities read from <code>dmidecode</code>
 
+
|-
=== Verify if the plugin returns the data in json format ===
+
| 3
* Test steps
+
| Verify if the plugin returns the data in json format
 +
|
 
# Build and install collectd with debug log level and capabilities plugin enabled.  
 
# Build and install collectd with debug log level and capabilities plugin enabled.  
 
# Start collectd
 
# Start collectd
 
# Read the data collectd by plugin using json formatter
 
# Read the data collectd by plugin using json formatter
 
     $ curl localhost:9104 | jq type
 
     $ curl localhost:9104 | jq type
* Expected result
+
|
** HTTP GET request should result in the display of a data structure about system capabilities read from <code>dmidecode</code>
+
* HTTP GET request should result in the display of a data structure about system capabilities read from <code>dmidecode</code>
** <code>jq</code> should display collected data in json fomat,
+
* <code>jq</code> should display collected data in json fomat,
** <code>jq</code> format should return answer: "object"
+
* <code>jq</code> format should return answer: "object"
 
+
|-
=== Check if the plugin returns information from pre-selected number of DMI types ===
+
| 4
*Test steps
+
| Check if the plugin returns information from pre-selected number of DMI types ===
 +
|
 
# Build and install collectd with debug log level and capabilities plugin enabled.  
 
# Build and install collectd with debug log level and capabilities plugin enabled.  
 
# Start collectd
 
# Start collectd
 
# Read the data collectd by plugin using json formatter
 
# Read the data collectd by plugin using json formatter
 
     $ curl localhost:9104 | jq type
 
     $ curl localhost:9104 | jq type
* Expected result
+
|
** HTTP GET request should result in the display of a data structure about system capabilities read from <code>dmidecode</code>.
+
* HTTP GET request should result in the display of a data structure about system capabilities read from <code>dmidecode</code>.
** The plugin should get information from pre-selected number of DMI types:
+
* The plugin should get information from pre-selected number of DMI types:
*** BIOS - 0
+
** BIOS - 0
*** System - 1
+
** System - 1
*** Baseboard - 2
+
** Baseboard - 2
*** Processor - 4
+
** Processor - 4
*** Cache - 7
+
** Cache - 7
*** Physical Memory Array - 16
+
** Physical Memory Array - 16
*** Memory Device - 17
+
** Memory Device - 17
*** IPMI Device - 38
+
** IPMI Device - 38
*** Onboard Devices Extended Information - 41
+
** Onboard Devices Extended Information - 41
 
+
|-
 +
| 5
 +
| Verify if the plugin returns correct BIOS information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the BIOS information returned by the plugin is consistent with DMIDECODE output
 +
  $ curl localhost:9104| jq .|awk '/BIOS/,/}/'
 +
  $ dmidecode | awk '/type 2,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 6
 +
| Verify if the plugin returns correct System information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the System information returned by the plugin is consistent with DMIDECODE output
 +
    $ curl localhost:9104| jq .|awk '/System Information/,/}/'
 +
    $ dmidecode | awk '/type 1,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 7
 +
| Verify if the plugin returns correct Baseboard information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the Baseboard information returned by the plugin is consistent with DMIDECODE output
 +
      $ curl localhost:9104| jq .|awk '/"BASEBOARD"/,/}/'
 +
      $ dmidecode | awk '/type 2,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 8
 +
| Verify if the plugin returns correct Processor information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the Processor information returned by the plugin is consistent with DMIDECODE output
 +
    $ curl localhost:9104| jq .|awk '/'PROCESSORS'/,/}/'
 +
    $ dmidecode | awk '/type 4,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 9
 +
| Verify if the plugin returns correct Cache information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the Cache information returned by the plugin is consistent with DMIDECODE output
 +
    $ curl localhost:9104| jq .|awk '/"CACHE"/,/"PHYSICAL/'
 +
    $ dmidecode | awk '/type 7,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 10
 +
| Verify if the plugin returns correct Physical Memory Array information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the Physical Memory Array information returned by the plugin is consistent with DMIDECODE output
 +
    $ curl localhost:9104| jq .|awk '/"PHYSICAL
 +
    $ dmidecode | awk '/type 16,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 11
 +
| Verify if the plugin returns correct Memory Device information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the Memory Device information returned by the plugin is consistent with DMIDECODE output
 +
    $ curl localhost:9104| jq .|awk '/"MEMORY DEVICES"/,/]/'
 +
    $ dmidecode | awk '/type 17,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 12
 +
| Verify if the plugin returns correct IPMI Device information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the IPMI Device information returned by the plugin is consistent with DMIDECODE output
 +
    $ curl localhost:9104| jq .|awk '/"IPMI DEVICE"/,/}/'
 +
    $ dmidecode | awk '/type 38,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 13
 +
| Verify if the plugin returns correct Onboard Devices Extended Information
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
# Start collectd
 +
# Compare if the Onboard Devices Extended information returned by the plugin is consistent with DMIDECODE output
 +
    $ curl localhost:9104| jq .|awk '/"ONBOARD DEVICES EXTENDED INFORMATION"/,/^$/'
 +
    $ dmidecode | awk '/type 41,/,/^$/'
 +
| The data should be 100% consistent
 +
|-
 +
| 14
 +
| Check collectd behavior upon lack of 'LoadPlugin capabilities' section in the configuration file
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin , but comment <code>LoadPlugin capabilities </code>
 +
# Start collectd
 +
| Warnings are raised in collectd log file
 +
|-
 +
| 15
 +
| Verify plugin behavior upon incorrect format of string configuration option
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
## Tested data formats for Host and Port field:
 +
### lack of quotes and correct address
 +
### empty
 +
### commas instead of dots in the ip address
 +
### random quoted string
 +
# Start collectd
 +
| Respective Warnings are raised in collectd log file
 +
|-
 +
| 16
 +
| Verify plugin behavior upon incorrect data type instead of string in configuration option
 +
|
 +
# Build and install collectd with basic configuration of capabilities plugin.
 +
## Boolean - true/false
 +
## Integer
 +
## Float
 +
## special chars
 +
## null
 +
# Start collectd
 +
| Respective Warnings are raised in collectd log file
 +
|}
 
== See also ==
 
== See also ==
 
* {{Plugin|capabilities}}
 
* {{Plugin|capabilities}}
 
* [https://wiki.opnfv.org/display/fastpath/Capabilities+Executed+Tests OPNFV Barometer tests]
 
* [https://wiki.opnfv.org/display/fastpath/Capabilities+Executed+Tests OPNFV Barometer tests]

Latest revision as of 15:56, 18 March 2020

This page contains tests instructions for the capabilities plugin. This page is meant to aid in testing at release time and be a guide for developing automated tests. Please add any tests that you have run when testing this plugin.

OPNFV/Barometer

# Description Test steps Expected result
1 Check collectd installation procedure with capabilities enabled
  1. Build and install collectd with debug log level and capabilities plugin enabled
  2. start collectd
  • Collectd has started
  • Capabilities plugin is loaded
2 Check if the plugin returns the data according to the design
  1. Build and install collectd with debug log level and capabilities plugin enabled.
  2. Start collectd
  3. Read the data collectd by plugin
   $ curl localhost:9104
  • HTTP GET request should result in the display of a data structure about system capabilities read from dmidecode
3 Verify if the plugin returns the data in json format
  1. Build and install collectd with debug log level and capabilities plugin enabled.
  2. Start collectd
  3. Read the data collectd by plugin using json formatter
   $ curl localhost:9104 | jq type
  • HTTP GET request should result in the display of a data structure about system capabilities read from dmidecode
  • jq should display collected data in json fomat,
  • jq format should return answer: "object"
4 Check if the plugin returns information from pre-selected number of DMI types ===
  1. Build and install collectd with debug log level and capabilities plugin enabled.
  2. Start collectd
  3. Read the data collectd by plugin using json formatter
   $ curl localhost:9104 | jq type
  • HTTP GET request should result in the display of a data structure about system capabilities read from dmidecode.
  • The plugin should get information from pre-selected number of DMI types:
    • BIOS - 0
    • System - 1
    • Baseboard - 2
    • Processor - 4
    • Cache - 7
    • Physical Memory Array - 16
    • Memory Device - 17
    • IPMI Device - 38
    • Onboard Devices Extended Information - 41
5 Verify if the plugin returns correct BIOS information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the BIOS information returned by the plugin is consistent with DMIDECODE output
 $ curl localhost:9104| jq .|awk '/BIOS/,/}/'
 $ dmidecode | awk '/type 2,/,/^$/'
The data should be 100% consistent
6 Verify if the plugin returns correct System information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the System information returned by the plugin is consistent with DMIDECODE output
   $ curl localhost:9104| jq .|awk '/System Information/,/}/'
   $ dmidecode | awk '/type 1,/,/^$/'
The data should be 100% consistent
7 Verify if the plugin returns correct Baseboard information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the Baseboard information returned by the plugin is consistent with DMIDECODE output
      $ curl localhost:9104| jq .|awk '/"BASEBOARD"/,/}/'
      $ dmidecode | awk '/type 2,/,/^$/'
The data should be 100% consistent
8 Verify if the plugin returns correct Processor information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the Processor information returned by the plugin is consistent with DMIDECODE output
   $ curl localhost:9104| jq .|awk '/'PROCESSORS'/,/}/'
   $ dmidecode | awk '/type 4,/,/^$/'
The data should be 100% consistent
9 Verify if the plugin returns correct Cache information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the Cache information returned by the plugin is consistent with DMIDECODE output
   $ curl localhost:9104| jq .|awk '/"CACHE"/,/"PHYSICAL/'
   $ dmidecode | awk '/type 7,/,/^$/'
The data should be 100% consistent
10 Verify if the plugin returns correct Physical Memory Array information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the Physical Memory Array information returned by the plugin is consistent with DMIDECODE output
   $ curl localhost:9104| jq .|awk '/"PHYSICAL
   $ dmidecode | awk '/type 16,/,/^$/'
The data should be 100% consistent
11 Verify if the plugin returns correct Memory Device information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the Memory Device information returned by the plugin is consistent with DMIDECODE output
   $ curl localhost:9104| jq .|awk '/"MEMORY DEVICES"/,/]/'
   $ dmidecode | awk '/type 17,/,/^$/'
The data should be 100% consistent
12 Verify if the plugin returns correct IPMI Device information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the IPMI Device information returned by the plugin is consistent with DMIDECODE output
   $ curl localhost:9104| jq .|awk '/"IPMI DEVICE"/,/}/'
   $ dmidecode | awk '/type 38,/,/^$/'
The data should be 100% consistent
13 Verify if the plugin returns correct Onboard Devices Extended Information
  1. Build and install collectd with basic configuration of capabilities plugin.
  2. Start collectd
  3. Compare if the Onboard Devices Extended information returned by the plugin is consistent with DMIDECODE output
   $ curl localhost:9104| jq .|awk '/"ONBOARD DEVICES EXTENDED INFORMATION"/,/^$/'
   $ dmidecode | awk '/type 41,/,/^$/'
The data should be 100% consistent
14 Check collectd behavior upon lack of 'LoadPlugin capabilities' section in the configuration file
  1. Build and install collectd with basic configuration of capabilities plugin , but comment LoadPlugin capabilities
  2. Start collectd
Warnings are raised in collectd log file
15 Verify plugin behavior upon incorrect format of string configuration option
  1. Build and install collectd with basic configuration of capabilities plugin.
    1. Tested data formats for Host and Port field:
      1. lack of quotes and correct address
      2. empty
      3. commas instead of dots in the ip address
      4. random quoted string
  2. Start collectd
Respective Warnings are raised in collectd log file
16 Verify plugin behavior upon incorrect data type instead of string in configuration option
  1. Build and install collectd with basic configuration of capabilities plugin.
    1. Boolean - true/false
    2. Integer
    3. Float
    4. special chars
    5. null
  2. Start collectd
Respective Warnings are raised in collectd log file

See also