Skip to content

Instantly share code, notes, and snippets.

@smccarney
Last active April 5, 2021 22:10
Show Gist options
  • Save smccarney/b059a5f4da1a9138af770217cbafaea3 to your computer and use it in GitHub Desktop.
Save smccarney/b059a5f4da1a9138af770217cbafaea3 to your computer and use it in GitHub Desktop.
Test Plan

Test Plan

Source file changes

  • src/manager.hpp
    • Manager::isConfigFileLoaded()
      • Test where false
      • Test where true
  • src/manager.cpp
    • Manager::configure()
      • waitUntilConfigFileLoaded()
        • JSON config file was already loaded before the wait
        • JSON config file was not already loaded before the wait
          • Test where was loaded after wait
          • Test where was not loaded after wait
      • Test where config file was loaded
        • Verify regulators are configured
      • Test where config file was not loaded
        • 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::monitor()
      • Test where disabling monitoring
        • Test where config file was loaded
          • Verify devices are closed
        • Test where config file was not loaded
          • Verify does nothing and no error results
    • Manager::clearHardwareData()
      • Test where config file was loaded
        • Verify clears cached data
      • Test where config file was not loaded
        • Verify does nothing and no error results
    • Manager::waitUntilConfigFileLoaded()
      • Test where file was already loaded
      • Test where file was not already loaded
        • Test where compatible system types list already found
        • Test where compatible system types list not already found
          • Test where compatible system types list not found within 5 minutes
          • Test where compatible system types list found within 5 minutes
            • Test where config file is not found
            • Test where config file is found
              • Test where parsing config file fails
                • Verify error messages written to the journal
                • Verify non-critical message logged
              • Test where parsing config file succeeds
          • Verify each sleep lasts 5 seconds
          • Verify stops waiting after a bit over 5 minutes
  • src/regsctl/main.cpp
    • Test where monitor enable specified
    • Test where monitor disable specified
    • Test where configure specified
      • Test where works
        • Verify exits with value 0
      • Test where fails
        • phosphor-regulators application not running
          • Verify writes exception description to stderr
          • Verify exits with value 1
        • Fails on server side due to lack of a JSON config file
          • Verify writes exception description to stderr
          • Verify exits with value 1
        • Times out on client side after 6 minutes
          • 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
    • Need to wait for EntityManager to publish data on D-bus
      • Valid config file found after waiting
        • Verify boot continues
        • Verify no error message written to journal
        • Verify no error logged
      • Invalid config file found after waiting
        • Verify boot stops
        • Verify error message written to journal
        • Verify critical error logged
          • Verify error contains relevant journal messages
      • Valid config file not found after waiting 5 minutes
        • 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