blob: 9ab4a30faf77f24387f03daf84dbb6d58bd9143c [file] [log] [blame]
Andrew Jefferya607a0d2018-05-23 16:15:26 +09301#include "physical.hpp"
2
3#include <sdbusplus/bus.hpp>
4
5#include <gtest/gtest.h>
6
7constexpr auto LED_OBJ = "/foo/bar/led";
8constexpr auto LED_SYSFS = "/sys/class/leds/test";
9
10using Action = sdbusplus::xyz::openbmc_project::Led::server::Physical::Action;
11
12TEST(Physical, ctor)
13{
14 sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
15 phosphor::led::Physical led(bus, LED_OBJ, LED_SYSFS);
16}
17
18TEST(Physical, off)
19{
20 sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
21 phosphor::led::Physical led(bus, LED_OBJ, LED_SYSFS);
22 led.state(Action::Off);
23}
24
25TEST(Physical, on)
26{
27 sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
28 phosphor::led::Physical led(bus, LED_OBJ, LED_SYSFS);
29 led.state(Action::On);
30}
31
32TEST(Physical, blink)
33{
34 sdbusplus::bus::bus bus = sdbusplus::bus::new_default();
35 phosphor::led::Physical led(bus, LED_OBJ, LED_SYSFS);
36 led.state(Action::Blink);
37}