- src/sensors.hpp
- Verify sizeof(SensorType) == 1
- Verify toString(SensorType) still works (regression)
- src/dbus_sensor.*
- DBusSensor()
- Verify 4 args to getTypeBasedProperties are returned successfully
- objectPath
- unit
- minValue
- maxValue
- Verify that 2 associations are returned successfully
- "chassis", "all_sensors",
- "inventory", "sensors",
- Verify that no signals are emitted until object is completely initialized
- Verify value is set correctly
- Verify maxValue is set correctly
- Verify minValue is set correctly
- Verify unit is set correctly
- Verify functional is set to true
- Verify available is set to true
- Verify all associations are created successfully
- /xyz/openbmc_project/sensors///chassis -> /xyz/openbmc_project/inventory/system/chassis
- /xyz/openbmc_project/inventory/system/chassis/all_sensors -> /xyz/openbmc_project/sensors//
- /xyz/openbmc_project/sensors///inventory -> /xyz/openbmc_project/inventory/system/chassis/<inventory_item>
- /xyz/openbmc_project/inventory/system/chassis/<inventory_item>/sensors -> /xyz/openbmc_project/sensors//
- Verify emits object_added at end. Verify it contains all interfaces and properties
- xyz.openbmc_project.Sensor.Value
- Value
- MaxValue
- MinValue
- Unit
- xyz.openbmc_project.State.Decorator.OperationalStatus
- Functional
- xyz.openbmc_project.State.Decorator.Availability
- Available
- xyz.openbmc_project.Association.Definitions
- Associations
- xyz.openbmc_project.Sensor.Value
- Verify 4 args to getTypeBasedProperties are returned successfully
- ~DBusSensor()
- Verify the object removed signal is emitted. Verify contains all interfaces
- xyz.openbmc_project.Sensor.Value
- xyz.openbmc_project.State.Decorator.OperationalStatus
- xyz.openbmc_project.State.Decorator.Availability
- xyz.openbmc_project.Association.Definitions
- Verify the object removed signal is emitted. Verify contains all interfaces
- disable()
- Verify sets value to NaN
- Verify PropertiesChanged signal emitted on first call
- Verify PropertiesChanged signal not emitted on second call
- Verify sets available to false
- Verify PropertiesChanged signal emitted on first call
- Verify PropertiesChanged signal not emitted on second call
- Verify sets value to NaN
- getName()
- Verify returns base name of sensor
- getRail()
- Verify returns unique ID of rail associated with sensor
- getType()
- Verify returns sensor type
- setToErrorState()
- Verify sets value to NaN
- Verify PropertiesChanged signal emitted on first call
- Verify PropertiesChanged signal not emitted on second call
- Verify sets functional to false
- Verify PropertiesChanged signal emitted on first call
- Verify PropertiesChanged signal not emitted on second call
- Verify sets value to NaN
- setValue()
- Test where value should be updated
- Verify value is changed
- Verify PropertiesChanged signal is emitted
- Test where value should be not be updated
- Verify value is not changed
- Verify PropertiesChanged signal is not emitted
- Verify sets functional to true
- Verify PropertiesChanged signal emitted on first call
- Verify PropertiesChanged signal not emitted on second call
- Verify sets available to true
- Verify PropertiesChanged signal emitted on first call
- Verify PropertiesChanged signal not emitted on second call
- Test where value should be updated
- getAssociations()
- Verify adds two tuples to vector
- Tuple 1: "chassis", "all_sensors",
- Tuple 2: "inventory", "sensors",
- Verify adds two tuples to vector
- getTypeBasedProperties()
- iout
- typeNamespace = "current"
- unit = Amperes
- minValue = 0.0
- maxValue = 500.0
- updatePolicy = ValueUpdatePolicy::hysteresis
- hysteresis = 1.0
- objectPath = "/xyz/openbmc_project/sensors/current/"
- iout_peak
- typeNamespace = "current"
- unit = Amperes
- minValue = 0.0
- maxValue = 500.0
- updatePolicy = ValueUpdatePolicy::highest
- hysteresis = 0.0
- objectPath = "/xyz/openbmc_project/sensors/current/"
- iout_valley
- typeNamespace = "current"
- unit = Amperes
- minValue = 0.0
- maxValue = 500.0
- updatePolicy = ValueUpdatePolicy::lowest
- hysteresis = 0.0
- objectPath = "/xyz/openbmc_project/sensors/current/"
- pout
- typeNamespace = "power"
- unit = Watts
- minValue = 0.0
- maxValue = 1000.0
- updatePolicy = ValueUpdatePolicy::hysteresis
- hysteresis = 1.0
- objectPath = "/xyz/openbmc_project/sensors/power/"
- temperature
- typeNamespace = "temperature"
- unit = DegreesC
- minValue = -50.0
- maxValue = 250.0
- updatePolicy = ValueUpdatePolicy::hysteresis
- hysteresis = 1.0
- objectPath = "/xyz/openbmc_project/sensors/temperature/"
- temperature_peak
- typeNamespace = "temperature"
- unit = DegreesC
- minValue = -50.0
- maxValue = 250.0
- updatePolicy = ValueUpdatePolicy::highest
- hysteresis = 0.0
- objectPath = "/xyz/openbmc_project/sensors/temperature/"
- vout
- typeNamespace = "voltage"
- unit = Volts
- minValue = -15.0
- maxValue = 15.0
- updatePolicy = ValueUpdatePolicy::hysteresis
- hysteresis = 0.001
- objectPath = "/xyz/openbmc_project/sensors/voltage/"
- vout_peak
- typeNamespace = "voltage"
- unit = Volts
- minValue = -15.0
- maxValue = 15.0
- updatePolicy = ValueUpdatePolicy::highest
- hysteresis = 0.0
- objectPath = "/xyz/openbmc_project/sensors/voltage/"
- vout_valley
- typeNamespace = "voltage"
- unit = Volts
- minValue = -15.0
- maxValue = 15.0
- updatePolicy = ValueUpdatePolicy::lowest
- hysteresis = 0.0
- objectPath = "/xyz/openbmc_project/sensors/voltage/"
- iout
- setValueToNaN()
- Test where current value is not NaN
- Verify value is changed to NaN
- Verify PropertiesChanged signal is emitted
- Test where current value is NaN
- Verify value is not changed
- Verify PropertiesChanged signal is not emitted
- Test where current value is not NaN
- shouldUpdateValue()
- Test where current value is NaN
- Verify returns true
- Test where current value is not NaN
- Test where update policy is hysteresis
- Test where difference is 0
- Verify returns false
- Test where difference is < hysteresis
- Verify returns false
- Test where difference is == hysteresis
- Verify returns true
- Test where difference is > hysteresis
- Verify returns true
- Test where difference is 0
- Test where update policy is highest
- Test where new value < current value
- Verify returns false
- Test where new value == current value
- Verify returns false
- Test where new value > current value
- Verify returns true
- Test where new value < current value
- Test where update policy is lowest
- Test where new value < current value
- Verify returns true
- Test where new value == current value
- Verify returns false
- Test where new value > current value
- Verify returns false
- Test where new value < current value
- Test where update policy is hysteresis
- Test where current value is NaN
- DBusSensor()
Created
April 24, 2021 14:52
-
-
Save smccarney/5ae989da1977162ae1a21c208d5302fc to your computer and use it in GitHub Desktop.
Test plan for DBusSensor class
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment