- tools/i2c/i2c_interface.hpp
- create()
- Verify busId data member set to correct value
- Verify devAddr data member set to correct value
- initialState parameter not specified
- Verify default value is OPEN and device is opened
- initialState parameter specified with value CLOSED
- Verify does not open device
- maxRetries parameter not specified
- Verify maxRetries data member set to 0
- maxRetries parameter specified
- Verify maxRetries data member set to parameter value
- create()
- tools/i2c/i2c.hpp
- I2CDevice(uint8_t, uint8_t, InitialState, int)
- Verify busId data member set to correct value
- Verify devAddr data member set to correct value
- initialState parameter not specified
- Verify default value is OPEN and device is opened
- initialState parameter specified with value CLOSED
- Verify does not open device
- maxRetries parameter not specified
- Verify maxRetries data member set to 0
- maxRetries parameter specified with non-zero value
- Verify maxRetries data member set to parameter value
- Verify busStr set to correct value
- I2CDevice(uint8_t, uint8_t, InitialState, int)
- tools/i2c/i2c.cpp
- getFuncs()
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- checkReadFuncs(int type)
- Test where read type is supported
- Test where read type is not supported
- Verify error message
- checkWriteFuncs(int type)
- Test where write type is supported
- Test where write type is not supported
- Verify error message
- open()
- ::open()
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- ioctl()
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- ::open()
- close()
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- read(uint8_t& data)
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- read(uint8_t addr, uint8_t& data)
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- read(uint8_t addr, uint16_t& data)
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- read(uint8_t addr, uint8_t& size, uint8_t* data, Mode mode)
- Mode::SMBUS
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- Mode::I2C
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- -1 returned
- Smaller number of bytes returned that what was requested
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- Mode::SMBUS
- write(uint8_t data)
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- write(uint8_t addr, uint8_t data)
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- write(uint8_t addr, uint16_t data)
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- write(uint8_t addr, uint8_t size, const uint8_t* data, Mode mode)
- Mode::SMBUS
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- Mode::I2C
- maxRetries set to 0
- Test where works
- Test where fails one time and exception thrown
- maxRetries set to 1
- Test where works
- Test where fails one time and then works
- Test where fails two times and exception thrown
- maxRetries set to 3
- Test where works
- Test where fails one time and then works
- Test where fails two times and then works
- Test where fails three times and then works
- Test where fails four times and exception thrown
- maxRetries set to 0
- Mode::SMBUS
- static create(uint8_t busId, uint8_t devAddr, InitialState initialState, int maxRetries)
- Verify busId data member set to correct value
- Verify devAddr data member set to correct value
- initialState parameter not specified
- Verify default value is OPEN and device is opened
- initialState parameter specified with value CLOSED
- Verify does not open device
- maxRetries parameter not specified
- Verify maxRetries data member set to 0
- maxRetries parameter specified
- Verify maxRetries data member set to parameter value
- global create(uint8_t busId, uint8_t devAddr, InitialState initialState, int maxRetries)
- Verify busId data member set to correct value
- Verify devAddr data member set to correct value
- initialState parameter not specified
- Verify default value is OPEN and device is opened
- initialState parameter specified with value CLOSED
- Verify does not open device
- maxRetries parameter not specified
- Verify maxRetries data member set to 0
- maxRetries parameter specified
- Verify maxRetries data member set to parameter value
- getFuncs()
- tools/i2c/test/mocked_i2c_interface.cpp
- Call create function from a testcase without initialState or maxRetries parameter
- Make sure builds successfully
- Call create function from a testcase with initialState and maxRetries parameters
- Make sure builds successfully
- Call create function from a testcase without initialState or maxRetries parameter
- Power on chassis
- Verify PMBus and I2C register writes occur
- Verify sensor values are successfully read
- Verify no errors logged
- Verify no unexpected journal entries from regulators application
- Power off chassis
- Verify no errors logged
- Verify no unexpected journal entries from regulators application
- Modify JSON file to make one I2C address invalid
- Create /etc/phosphor-regulators override directory
- Copy shipped JSON file into override directory
- Modify file
- Send signal to phosphor-regulators application to reload JSON file
- Power on system
- Verify journal message written for bad I2C address
- Verify no unexpected journal messages
- Verify error logged for bad I2C address
- Verify no unexpected errors logged
- Power off system
- Verify no unexpected journal messages
- Verify no unexpected errors logged