Skip to content

Instantly share code, notes, and snippets.

@smccarney
Last active February 23, 2021 20:55
Show Gist options
  • Save smccarney/8801cad1fe1c4ae8913e57d9474bfaac to your computer and use it in GitHub Desktop.
Save smccarney/8801cad1fe1c4ae8913e57d9474bfaac to your computer and use it in GitHub Desktop.
Test Plan

Test Plan

Source file changes

  • src/error_logging.cpp
    • logConfigFileError()
      • Test were severity is not Critical
        • Verify error logged with ID xyz.openbmc_project.Power.Regulators.Error.ConfigFile
        • Verify error severity is not critical in the PEL
        • Verify the PowerFault field is set to false
      • Test were severity is Critical
        • Verify error logged with ID xyz.openbmc_project.Power.Regulators.Error.ConfigFile.Critical
        • Verify error severity is critical_system_term in the PEL
        • Verify the PowerFault field is set to true
  • src/manager.cpp
    • Manager::configure()
      • Test where works
      • Test where fails due to lack of a valid JSON config file
        • Verify error message written to the journal
        • Verify critical message logged
        • Verify InternalFailure exception thrown causing D-Bus method call to return an error
    • Manager::loadConfigFile()
      • Test where works
      • Test where fails due to invalid JSON config file
        • Verify error messages written to the journal
        • Verify non-critical message logged
  • src/interfaces/manager_interface.cpp
    • callbackConfigure()
      • Test where works
      • Test where fails and an exception that descends from sdbusplus::exception_t is thrown
        • Verify exception is caught and converted into an sd_bus error struct
        • Verify sd_bus error is passed to the client causing an SdBusError exception to be thrown in the client.
    • callbackMonitor()
      • Test where works
      • Test where fails and an exception that descends from sdbusplus::exception_t is thrown
        • Verify exception is caught and converted into an sd_bus error struct
        • Verify sd_bus error is passed to the client causing an SdBusError exception to be thrown in the client.
  • src/regsctl/main.cpp
    • Test where command line syntax is invalid
    • Test where configure specified
      • Test where works
        • Verify exits with value 0
      • Test where fails
        • phosphor-regulators application not running
        • Invalid D-Bus method name
        • Fails on server side due to lack of a JSON config file
        • Verify writes exception description to stderr
        • Verify exits with value 1
    • Test where monitor enable specified
      • Test where works
        • Verify exits with value 0
      • Test where fails
        • phosphor-regulators application not running
        • Invalid D-Bus method name
        • Fails on server side due to lack of a JSON config file
        • Verify writes exception description to stderr
        • Verify exits with value 1
    • Test where monitor disable specified
      • Test where works
        • Verify exits with value 0
      • Test where fails
        • phosphor-regulators application not running
        • Invalid D-Bus method name
        • Fails on server side due to lack of a JSON config file
        • Verify writes exception description to stderr
        • Verify exits with value 1

End to end tests

  • phosphor-regulators application started
    • Valid config file found
      • Verify no error message written to journal
      • Verify no error logged
    • Valid config file not found
      • Verify error message written to journal
      • Verify non-critical error logged
        • Verify error contains relevant journal messages
  • phosphor-regulators receives SIGHUP signal and reloads config file
    • Valid config file found
      • Verify no error message written to journal
      • Verify no error logged
    • Valid config file not found
      • Verify error message written to journal
      • Verify non-critical error logged
        • Verify error contains relevant journal messages
  • Boot system
    • obmcutil chassison
      • Valid config file found
        • Verify boot continues
        • Verify no error message written to journal
        • Verify no error logged
      • Valid config file not found
        • Verify boot stops
        • Verify error message written to journal
        • Verify critical error logged
          • Verify error contains relevant journal messages
    • obmcutil poweron
      • Valid config file found
        • Verify boot continues
        • Verify no error message written to journal
        • Verify no error logged
      • Valid config file not found
        • Verify boot stops
        • Verify error message written to journal
        • Verify critical error logged
          • Verify error contains relevant journal messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment