Skip to content

Instantly share code, notes, and snippets.

@smccarney
Created April 27, 2021 18:46
Show Gist options
  • Save smccarney/69efb813c0005571aee687f67e489278 to your computer and use it in GitHub Desktop.
Save smccarney/69efb813c0005571aee687f67e489278 to your computer and use it in GitHub Desktop.
Test Plan for DBusSensors Class

Test plan for DBusSensors

Code changes

  • src/dbus_sensor.*
    • Constructor
      • Verify sets lastUpdateTime accurately
    • disable()
      • Verify sets lastUpdateTime accurately
    • getLastUpdateTime()
      • Verify value is the last time the sensor was updated according to the system clock.
    • setLastUpdateTime()
      • Verify sets lastUpdateTime to current system clock time
    • setToErrorState()
      • Verify sets lastUpdateTime accurately
    • setValue()
      • Verify sets lastUpdateTime accurately
  • src/dbus_sensors.*
    • DBusSensors()
      • Verify it adds the org.freedesktop.DBus.ObjectManager interface on the object path /xyz/openbmc_project/sensors for the current service/bus name.
      • Test where an exception occurs
    • ~DBusSensors()
      • Verify it removes all sensors from D-Bus
      • Verify InterfacesRemoved signal sent for all sensors
      • Verify it removes the org.freedesktop.DBus.ObjectManager interface on object path /xyz/openbmc_project/sensors for the current service/bus name. n enable()
      • Nothing to test
    • endCycle()
      • Test where all sensors were updated
        • Verify no sensors are deleted
      • Test where some sensors were updated
        • Verify the sensors that were not updated are deleted
      • Test where no sensors were updated
        • Verify all sensors are deleted
      • Verify that InterfacesRemoved signal is emitted for each deleted sensor
      • Verify a debug journal message is written for each deleted sensor
    • endRail()
      • Test where errorOccurred is true
        • Verify all sensors for the current rail are set to the error state
        • Verify other sensors are not modified
      • Test where errorOccurred is false
        • Verify no sensors are modified
      • Verify rail data members are cleared
    • disable()
      • Verify all sensors set to the disabled state
    • setValue()
      • Verify generated sensor name is correct
      • Test where sensor already exists
        • Verify value is updated
      • Test where sensor does not already exist
        • Verify sensor is created
        • Verify sensor is added to map
        • Verify debug journal message
        • Test where an exception occurs
    • startCycle()
      • Verify current system time stored in cycleStateTime
    • startRail()
      • Verify rail information stored in data members n src/sensors.hpp
    • Just comment changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment