1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-10 17:57:40 +03:00

test: show is_initialized flag in log message of test-sd-device

And drop devpath, as it is redundant for most cases.
This commit is contained in:
Yu Watanabe 2018-10-31 10:01:45 +09:00
parent ecbe9873a9
commit 754d6c26b4

View File

@ -17,7 +17,7 @@ static void test_sd_device_basic(void) {
assert_se(sd_device_enumerator_new(&e) >= 0);
assert_se(sd_device_enumerator_allow_uninitialized(e) >= 0);
FOREACH_DEVICE(e, d) {
const char *syspath, *devpath, *subsystem, *val;
const char *syspath, *subsystem, *val;
dev_t devnum;
usec_t usec;
int i, r;
@ -39,7 +39,7 @@ static void test_sd_device_basic(void) {
r = sd_device_get_driver(d, &val);
assert_se(r >= 0 || r == -ENOENT);
assert_se(sd_device_get_devpath(d, &devpath) >= 0);
assert_se(sd_device_get_devpath(d, &val) >= 0);
r = sd_device_get_devname(d, &val);
assert_se(r >= 0 || r == -ENOENT);
@ -49,9 +49,9 @@ static void test_sd_device_basic(void) {
r = sd_device_get_sysnum(d, &val);
assert_se(r >= 0 || r == -ENOENT);
r = sd_device_get_is_initialized(d);
assert_se(r >= 0);
if (r > 0) {
i = sd_device_get_is_initialized(d);
assert_se(i >= 0);
if (i > 0) {
r = sd_device_get_usec_since_initialized(d, &usec);
assert_se(r >= 0 || r == -ENODATA);
}
@ -62,7 +62,7 @@ static void test_sd_device_basic(void) {
r = sd_device_get_property_value(d, "ID_NET_DRIVER", &val);
assert_se(r >= 0 || r == -ENOENT);
log_debug("syspath:%s devpath:%s subsystem:%s", syspath, devpath, strempty(subsystem));
log_debug("subsystem:%s syspath:%s initialized:%s", strna(subsystem), syspath, yes_no(i));
}
}