Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3753107a authored by David Anderson's avatar David Anderson Committed by Automerger Merge Worker
Browse files

Merge "libdm: Fix failing test on older kernels." am: f723ef30 am: eec0f740 am: e09878e2

parents e1e86645 e09878e2
Loading
Loading
Loading
Loading
+12 −1
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <time.h>
#include <time.h>
#include <unistd.h>
#include <unistd.h>


@@ -692,7 +693,17 @@ TEST(libdm, CreateEmptyDevice) {
}
}


TEST(libdm, UeventAfterLoadTable) {
TEST(libdm, UeventAfterLoadTable) {
    static const char* kDeviceName = "libmd-test-uevent-load-table";
    static const char* kDeviceName = "libdm-test-uevent-load-table";

    struct utsname u;
    ASSERT_EQ(uname(&u), 0);

    unsigned int major, minor;
    ASSERT_EQ(sscanf(u.release, "%u.%u", &major, &minor), 2);

    if (major < 5 || (major == 5 && minor < 15)) {
        GTEST_SKIP() << "Skipping test on kernel < 5.15";
    }


    DeviceMapper& dm = DeviceMapper::Instance();
    DeviceMapper& dm = DeviceMapper::Instance();
    ASSERT_TRUE(dm.CreateEmptyDevice(kDeviceName));
    ASSERT_TRUE(dm.CreateEmptyDevice(kDeviceName));