Skip to content

Instantly share code, notes, and snippets.

@smccarney
Created February 7, 2024 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smccarney/e7a250011133c7e3040a8bce240705c5 to your computer and use it in GitHub Desktop.
Save smccarney/e7a250011133c7e3040a8bce240705c5 to your computer and use it in GitHub Desktop.
pseq: Test plan for Services class hierarchy

pseq: Test plan for Services class hierarchy

Automated tests

  • Run all automated tests and verify they pass

Manual tests

  • BMCServices
    • BMCServices(sdbusplus::bus_t& bus)
      • Verify bus can be obtained from getBus() and used successfully
    • sdbusplus::bus_t& getBus()
      • Verify bus can be used successfully
    • void logErrorMsg(const std::string& message)
      • Verify journal entry is created
        • Verify message
        • Verify level is error
        • Verify other fields
    • void logInfoMsg(const std::string& message)
      • Verify journal entry is created
        • Verify message
        • Verify level is info
        • Verify other fields
    • void logError(const std::string& message, Entry::Level severity, std::map<std::string, std::string>& additionalData)
      • Test where works
        • Verify PID is set to the calling process's ID
        • Test where severity is Critical
          • Verify SEVERITY_DETAIL field is set to SYSTEM_TERM in additional data
        • Test where severity is not Critical
          • Verify SEVERITY_DETAIL field is not set in additional data
        • Verify base BMC error log entry is created
          • Verify message
          • Verify severity
          • Verify additional data
        • Verify PEL is created
          • Verify based on message registry entry that matches the message
          • Verify severity
          • Verify additional data
          • Verify callouts
          • Verify journal is automatically captured if it is a power sequencer error
      • Test where fails
        • Verify no exception is thrown by this method
        • Verify journal entry is created
          • Verify journal message includes correct data
            • Error message
            • Exception message
          • Verify level is error
          • Verify other fields
    • bool isPresent(const std::string& inventoryPath)
      • Test where works
        • Test where hardware is present
        • Test where hardware is missing
          • Test where present property is False
          • Test where expected exception is thrown
      • Test where fails
        • Test where unexpected exception is thrown
          • Verify exception is re-thrown
    • std::vector getGPIOValues(const std::string& chipLabel)
      • Test where opening chip fails
        • Invalid chip label specified
        • Verify exception is thrown with helpful error message
      • Test where opening chip works
        • Verify obtains the correct number of lines (readable GPIOs)
        • Verify journal message with chip name, label, and number of lines
      • Test where reading line value fails
        • Verify exception is thrown with helpful error message
      • Test where reading line values succeeds
        • Verify correct number of values are read
        • Verify correct values are read
        • Verify values are stored in the correct order in the vector
    • std::unique_ptr createPMBus(uint8_t bus, uint16_t address, const std::string& driverName = "", size_t instance = 0)
      • Verify generated path has the correct format
        • Test that address string in hexadecimal format
        • Test that address string has correct number of leading zeros
      • Verify generated path exists in sysfs
        • Test where bus number is < 10
        • Test where bus number is >= 10
      • Test where creating PMBus object works
        • Verify hwmon sub-directory is found and stored in data member
      • Test where creating PMBus object fails
        • Test where path does not exist
        • Test where hwmon sub-directory cannot be found
          • Verify info journal entry is created
    • bool isExpectedException(const sdbusplus::exception_t& e)
      • Test where error was expected
        • Object path does not exist
        • Object path does not implement interface with present property
      • Test where error was not expected

Commands

  • journalctl /tmp/bmc_services_test -o json-pretty
  • peltool -l
  • peltool -i
  • obmcutil listlogs
  • obmcutil showlog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment