#include "trompeloeil_doctest.h"
#include "dbus-helpers/dbus_rauc_server.h"
#include "pretty_printers.h"
#include "system/Firmware.h"
#include "test_log_setup.h"
#include "test_sysrepo_helpers.h"
#include "tests/configure.cmake.h"
#include "tests/mock/sysrepo/events.h"

using namespace std::literals;

TEST_CASE("Firmware in czechlight-system, RPC")
{
    trompeloeil::sequence seq1;

    TEST_SYSREPO_INIT_LOGS;
    TEST_SYSREPO_INIT;
    TEST_SYSREPO_INIT_CLIENT;

    auto dbusServerConnection = sdbus::createSessionBusConnection("de.pengutronix.rauc");
    auto dbusClientConnectionSignals = sdbus::createSessionBusConnection();
    auto dbusClientConnectionMethods = sdbus::createSessionBusConnection();
    dbusClientConnectionSignals->enterEventLoopAsync();
    dbusClientConnectionMethods->enterEventLoopAsync();
    dbusServerConnection->enterEventLoopAsync();

    std::map<std::string, velia::system::RAUC::SlotProperties> dbusRaucStatus = {
        {"rootfs.1", {
                         {"activated.count", uint32_t {39}},
                         {"activated.timestamp", "2021-01-13T17:20:18Z"},
                         {"bootname", "B"},
                         {"boot-status", "good"},
                         {"bundle.compatible", "czechlight-clearfog"},
                         {"bundle.version", "v4-103-g34d2f48"},
                         {"class", "rootfs"},
                         {"device", "/dev/mmcblk0p3"},
                         {"installed.count", uint32_t {39}},
                         {"installed.timestamp", "2021-01-13T17:20:15Z"},
                         {"mountpoint", "/"},
                         {"sha256", "07b30d065c7aad64d2006ce99fd339c929d3ca97b666fca4584b9ef726469fc4"},
                         {"size", uint64_t {45601892}},
                         {"state", "booted"},
                         {"status", "ok"},
                         {"type", "ext4"},
                     }},
        {"rootfs.0", {
                         {"activated.count", uint32_t {41}},
                         {"activated.timestamp", "2021-01-13T17:15:54Z"},
                         {"bootname", "A"},
                         {"boot-status", "bad"},
                         {"bundle.compatible", "czechlight-clearfog"},
                         {"bundle.version", "v4-104-ge80fcd4"},
                         {"class", "rootfs"},
                         {"device", "/dev/mmcblk0p1"},
                         {"installed.count", uint32_t {41}},
                         {"installed.timestamp", "2021-01-13T17:15:50Z"},
                         {"sha256", "6d81e8f341edd17c127811f7347c7e23d18c2fc25c0bdc29ac56999cc9c25629"},
                         {"size", uint64_t {45647664}},
                         {"state", "inactive"},
                         {"status", "ok"},
                         {"type", "ext4"},
                     }},
        {"cfg.1", {
                      {"bundle.compatible", "czechlight-clearfog"},
                      {"bundle.version", "v4-103-g34d2f48"},
                      {"class", "cfg"},
                      {"device", "/dev/mmcblk0p4"},
                      {"installed.count", uint32_t {39}},
                      {"installed.timestamp", "2021-01-13T17:20:18Z"},
                      {"mountpoint", "/cfg"},
                      {"parent", "rootfs.1"},
                      {"sha256", "5ca1b6c461fc194055d52b181f57c63dc1d34c19d041f6395e6f6abc039692bb"},
                      {"size", uint64_t {108}},
                      {"state", "active"},
                      {"status", "ok"},
                      {"type", "ext4"},
                  }},
        {"cfg.0", {
                      {"bundle.compatible", "czechlight-clearfog"},
                      {"bundle.version", "v4-104-ge80fcd4"},
                      {"class", "cfg"},
                      {"device", "/dev/mmcblk0p2"},
                      {"installed.count", uint32_t {41}},
                      {"installed.timestamp", "2021-01-13T17:15:54Z"},
                      {"parent", "rootfs.0"},
                      {"sha256", "5ca1b6c461fc194055d52b181f57c63dc1d34c19d041f6395e6f6abc039692bb"},
                      {"size", uint64_t {108}},
                      {"state", "inactive"},
                      {"status", "ok"},
                      {"type", "ext4"},
                  }},
    };
    auto raucServer = DBusRAUCServer(*dbusServerConnection, "rootfs.1", dbusRaucStatus);
    auto sysrepo = std::make_shared<velia::system::Firmware>(srConn, *dbusClientConnectionSignals, *dbusClientConnectionMethods);

    REQUIRE(dataFromSysrepo(client, "/czechlight-system:firmware", SR_DS_OPERATIONAL) == std::map<std::string, std::string> {
                {"/firmware-slot[name='A']", ""},
                {"/firmware-slot[name='A']/boot-status", "bad"},
                {"/firmware-slot[name='A']/installed", "2021-01-13T17:15:50Z"},
                {"/firmware-slot[name='A']/name", "A"},
                {"/firmware-slot[name='A']/state", "inactive"},
                {"/firmware-slot[name='A']/version", "v4-104-ge80fcd4"},
                {"/firmware-slot[name='B']", ""},
                {"/firmware-slot[name='B']/boot-status", "good"},
                {"/firmware-slot[name='B']/installed", "2021-01-13T17:20:15Z"},
                {"/firmware-slot[name='B']/name", "B"},
                {"/firmware-slot[name='B']/state", "booted"},
                {"/firmware-slot[name='B']/version", "v4-103-g34d2f48"},
                {"/installation", ""},
                {"/installation/message", ""},
                {"/installation/status", "none"},
            });

    SECTION("Firmware install RPC")
    {
        auto rpcInput = std::make_shared<sysrepo::Vals>(1);
        rpcInput->val(0)->set("/czechlight-system:firmware/installation/install/url", "/path/to/bundle/update.raucb");

        SECTION("Installation runs")
        {
            DBusRAUCServer::InstallBehaviour installType;
            std::map<std::string, std::string> expectedFinished, expectedInProgress = {
                {"/message", ""},
                {"/status", "in-progress"},
            };
            size_t expectedNotificationsCount;
            std::string expectedLastNotificationMsg;

            // subscribe to notifications
            EventWatcher events;
            subscription->event_notif_subscribe("czechlight-system", events, "/czechlight-system:firmware/installation/update");

            SECTION("Successfull install")
            {
                installType = DBusRAUCServer::InstallBehaviour::OK;
                expectedFinished = {
                    {"/message", ""},
                    {"/status", "succeeded"},
                };
                expectedNotificationsCount = 22;
                expectedLastNotificationMsg = "Installing done.";
            }

            SECTION("Unsuccessfull install")
            {
                installType = DBusRAUCServer::InstallBehaviour::FAILURE;
                expectedFinished = {
                    {"/message", "Failed to download bundle https://10.88.3.11:8000/update.raucb: Transfer failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number"},
                    {"/status", "failed"},
                };
                expectedNotificationsCount = 6;
                expectedLastNotificationMsg = "Installing failed.";
            }

            raucServer.installBundleBehaviour(installType);
            auto res = client->rpc_send("/czechlight-system:firmware/installation/install", rpcInput);
            REQUIRE(res->val_cnt() == 0);

            std::this_thread::sleep_for(10ms); // lets wait a while, so the RAUC's callback for operation changed takes place
            REQUIRE(dataFromSysrepo(client, "/czechlight-system:firmware/installation", SR_DS_OPERATIONAL) == expectedInProgress);

            std::this_thread::sleep_for(2s); // lets wait a while, so the installation can finish
            REQUIRE(dataFromSysrepo(client, "/czechlight-system:firmware/installation", SR_DS_OPERATIONAL) == expectedFinished);

            // check updates notification count and that at least some of them are reasonable
            REQUIRE(events.count() == expectedNotificationsCount);
            REQUIRE(events.peek(0).data["/czechlight-system:firmware/installation/update/message"] == "Installing");
            REQUIRE(events.peek(0).data["/czechlight-system:firmware/installation/update/progress"] == "0");
            REQUIRE(events.peek(events.count() - 1).data["/czechlight-system:firmware/installation/update/message"] == expectedLastNotificationMsg);
            REQUIRE(events.peek(events.count() - 1).data["/czechlight-system:firmware/installation/update/progress"] == "100");

            // check updates notification progress is an increasing sequence
            for (size_t i = 1; i < events.count(); i++) {
                auto prevProgress = std::stoi(events.peek(i - 1).data["/czechlight-system:firmware/installation/update/progress"]);
                auto currProgress = std::stoi(events.peek(i).data["/czechlight-system:firmware/installation/update/progress"]);
                REQUIRE(prevProgress <= currProgress);
            }
        }

        SECTION("Unsuccessfull install followed by successfull install")
        {
            std::map<std::string, std::string> expected;

            // invoke unsuccessfull install
            raucServer.installBundleBehaviour(DBusRAUCServer::InstallBehaviour::FAILURE);
            client->rpc_send("/czechlight-system:firmware/installation/install", rpcInput);

            expected = {
                {"/message", "Failed to download bundle https://10.88.3.11:8000/update.raucb: Transfer failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version number"},
                {"/status", "failed"},
            };
            std::this_thread::sleep_for(2s); // lets wait a while, so the installation can finish
            REQUIRE(dataFromSysrepo(client, "/czechlight-system:firmware/installation", SR_DS_OPERATIONAL) == expected);

            // invoke successfull install
            raucServer.installBundleBehaviour(DBusRAUCServer::InstallBehaviour::OK);
            client->rpc_send("/czechlight-system:firmware/installation/install", rpcInput);

            expected = {
                {"/message", ""},
                {"/status", "in-progress"},
            };
            std::this_thread::sleep_for(10ms); // lets wait a while, so the RAUC's callback for operation changed takes place
            REQUIRE(dataFromSysrepo(client, "/czechlight-system:firmware/installation", SR_DS_OPERATIONAL) == expected);

            expected = {
                {"/message", ""},
                {"/status", "succeeded"},
            };
            std::this_thread::sleep_for(2s); // lets wait a while, so the installation can finish
            REQUIRE(dataFromSysrepo(client, "/czechlight-system:firmware/installation", SR_DS_OPERATIONAL) == expected);

        }
        SECTION("Installation in progress")
        {
            client->rpc_send("/czechlight-system:firmware/installation/install", rpcInput);
            std::this_thread::sleep_for(10ms);

            SECTION("Invoking second installation throws")
            {
                REQUIRE_THROWS_WITH_AS(client->rpc_send("/czechlight-system:firmware/installation/install", rpcInput), "User callback failed", sysrepo::sysrepo_exception);
            }

            SECTION("Firmware slot data are available")
            {
                // RAUC does not respond to GetSlotStatus when another operation in progress, so let's check we use the cached data
                REQUIRE(dataFromSysrepo(client, "/czechlight-system:firmware", SR_DS_OPERATIONAL) == std::map<std::string, std::string> {
                    {"/firmware-slot[name='A']", ""},
                    {"/firmware-slot[name='A']/boot-status", "bad"},
                    {"/firmware-slot[name='A']/installed", "2021-01-13T17:15:50Z"},
                    {"/firmware-slot[name='A']/name", "A"},
                    {"/firmware-slot[name='A']/state", "inactive"},
                    {"/firmware-slot[name='A']/version", "v4-104-ge80fcd4"},
                    {"/firmware-slot[name='B']", ""},
                    {"/firmware-slot[name='B']/boot-status", "good"},
                    {"/firmware-slot[name='B']/installed", "2021-01-13T17:20:15Z"},
                    {"/firmware-slot[name='B']/name", "B"},
                    {"/firmware-slot[name='B']/state", "booted"},
                    {"/firmware-slot[name='B']/version", "v4-103-g34d2f48"},
                    {"/installation", ""},
                    {"/installation/message", ""},
                    {"/installation/status", "in-progress"},
                });
            }
        }
    }
}

TEST_CASE("Firmware in czechlight-system, slot status")
{
    trompeloeil::sequence seq1;

    TEST_SYSREPO_INIT_LOGS;
    TEST_SYSREPO_INIT;
    TEST_SYSREPO_INIT_CLIENT;

    auto dbusServerConnection = sdbus::createSessionBusConnection("de.pengutronix.rauc");
    auto dbusClientConnectionSignals = sdbus::createSessionBusConnection();
    auto dbusClientConnectionMethods = sdbus::createSessionBusConnection();
    dbusClientConnectionSignals->enterEventLoopAsync();
    dbusClientConnectionMethods->enterEventLoopAsync();
    dbusServerConnection->enterEventLoopAsync();

    std::map<std::string, velia::system::RAUC::SlotProperties> dbusRaucStatus;
    std::map<std::string, std::string> expected;

    SECTION("Complete data")
    {
        dbusRaucStatus = {
            {"rootfs.1", {
                             {"activated.count", uint32_t {39}},
                             {"activated.timestamp", "2021-01-13T17:20:18Z"},
                             {"bootname", "B"},
                             {"boot-status", "good"},
                             {"bundle.compatible", "czechlight-clearfog"},
                             {"bundle.version", "v4-103-g34d2f48"},
                             {"class", "rootfs"},
                             {"device", "/dev/mmcblk0p3"},
                             {"installed.count", uint32_t {39}},
                             {"installed.timestamp", "2021-01-13T17:20:15Z"},
                             {"mountpoint", "/"},
                             {"sha256", "07b30d065c7aad64d2006ce99fd339c929d3ca97b666fca4584b9ef726469fc4"},
                             {"size", uint64_t {45601892}},
                             {"state", "booted"},
                             {"status", "ok"},
                             {"type", "ext4"},
                         }},
            {"rootfs.0", {
                             {"activated.count", uint32_t {41}},
                             {"activated.timestamp", "2021-01-13T17:15:54Z"},
                             {"bootname", "A"},
                             {"boot-status", "bad"},
                             {"bundle.compatible", "czechlight-clearfog"},
                             {"bundle.version", "v4-104-ge80fcd4"},
                             {"class", "rootfs"},
                             {"device", "/dev/mmcblk0p1"},
                             {"installed.count", uint32_t {41}},
                             {"installed.timestamp", "2021-01-13T17:15:50Z"},
                             {"sha256", "6d81e8f341edd17c127811f7347c7e23d18c2fc25c0bdc29ac56999cc9c25629"},
                             {"size", uint64_t {45647664}},
                             {"state", "inactive"},
                             {"status", "ok"},
                             {"type", "ext4"},
                         }},
            {"cfg.1", {
                             {"bundle.compatible", "czechlight-clearfog"},
                             {"bundle.version", "v4-103-g34d2f48"},
                             {"class", "cfg"},
                             {"device", "/dev/mmcblk0p4"},
                             {"installed.count", uint32_t {39}},
                             {"installed.timestamp", "2021-01-13T17:20:18Z"},
                             {"mountpoint", "/cfg"},
                             {"parent", "rootfs.1"},
                             {"sha256", "5ca1b6c461fc194055d52b181f57c63dc1d34c19d041f6395e6f6abc039692bb"},
                             {"size", uint64_t {108}},
                             {"state", "active"},
                             {"status", "ok"},
                             {"type", "ext4"},
                         }},
            {"cfg.0", {
                             {"bundle.compatible", "czechlight-clearfog"},
                             {"bundle.version", "v4-104-ge80fcd4"},
                             {"class", "cfg"},
                             {"device", "/dev/mmcblk0p2"},
                             {"installed.count", uint32_t {41}},
                             {"installed.timestamp", "2021-01-13T17:15:54Z"},
                             {"parent", "rootfs.0"},
                             {"sha256", "5ca1b6c461fc194055d52b181f57c63dc1d34c19d041f6395e6f6abc039692bb"},
                             {"size", uint64_t {108}},
                             {"state", "inactive"},
                             {"status", "ok"},
                             {"type", "ext4"},
                         }},
        };

        expected = {
            {"[name='A']/boot-status", "bad"},
            {"[name='A']/installed", "2021-01-13T17:15:50Z"},
            {"[name='A']/name", "A"},
            {"[name='A']/state", "inactive"},
            {"[name='A']/version", "v4-104-ge80fcd4"},
            {"[name='B']/boot-status", "good"},
            {"[name='B']/installed", "2021-01-13T17:20:15Z"},
            {"[name='B']/name", "B"},
            {"[name='B']/state", "booted"},
            {"[name='B']/version", "v4-103-g34d2f48"},
        };
    }

    SECTION("Missing data in rootfs.0")
    {
        dbusRaucStatus = {
            {"rootfs.1", {
                             {"activated.count", uint32_t {39}},
                             {"activated.timestamp", "2021-01-13T17:20:18Z"},
                             {"bootname", "B"},
                             {"boot-status", "good"},
                             {"bundle.compatible", "czechlight-clearfog"},
                             {"bundle.version", "v4-103-g34d2f48"},
                             {"class", "rootfs"},
                             {"device", "/dev/mmcblk0p3"},
                             {"installed.count", uint32_t {39}},
                             {"installed.timestamp", "2021-01-13T17:20:15Z"},
                             {"mountpoint", "/"},
                             {"sha256", "07b30d065c7aad64d2006ce99fd339c929d3ca97b666fca4584b9ef726469fc4"},
                             {"size", uint64_t {45601892}},
                             {"state", "booted"},
                             {"status", "ok"},
                             {"type", "ext4"},
                         }},
            {"rootfs.0", {
                             {"bootname", "A"},
                             {"boot-status", "bad"},
                             {"class", "rootfs"},
                             {"device", "/dev/mmcblk0p1"},
                             {"sha256", "6d81e8f341edd17c127811f7347c7e23d18c2fc25c0bdc29ac56999cc9c25629"},
                             {"size", uint64_t {45647664}},
                             {"state", "inactive"},
                             {"status", "ok"},
                             {"type", "ext4"},
                         }},
        };

        expected = {
            {"[name='A']/boot-status", "bad"},
            {"[name='A']/name", "A"},
            {"[name='A']/state", "inactive"},
            {"[name='B']/boot-status", "good"},
            {"[name='B']/installed", "2021-01-13T17:20:15Z"},
            {"[name='B']/name", "B"},
            {"[name='B']/state", "booted"},
            {"[name='B']/version", "v4-103-g34d2f48"},
        };
    }

    SECTION("Missing bootname in rootfs.0")
    {
        dbusRaucStatus = {
            {"rootfs.1", {
                             {"activated.count", uint32_t {39}},
                             {"activated.timestamp", "2021-01-13T17:20:18Z"},
                             {"bootname", "B"},
                             {"boot-status", "good"},
                             {"bundle.compatible", "czechlight-clearfog"},
                             {"bundle.version", "v4-103-g34d2f48"},
                             {"class", "rootfs"},
                             {"device", "/dev/mmcblk0p3"},
                             {"installed.count", uint32_t {39}},
                             {"installed.timestamp", "2021-01-13T17:20:15Z"},
                             {"mountpoint", "/"},
                             {"sha256", "07b30d065c7aad64d2006ce99fd339c929d3ca97b666fca4584b9ef726469fc4"},
                             {"size", uint64_t {45601892}},
                             {"state", "booted"},
                             {"status", "ok"},
                             {"type", "ext4"},
                         }},
            {"rootfs.0", {
                             {"boot-status", "bad"},
                             {"class", "rootfs"},
                             {"device", "/dev/mmcblk0p1"},
                             {"sha256", "6d81e8f341edd17c127811f7347c7e23d18c2fc25c0bdc29ac56999cc9c25629"},
                             {"size", uint64_t {45647664}},
                             {"state", "inactive"},
                             {"status", "ok"},
                             {"type", "ext4"},
                         }},
        };

        expected = {
            {"[name='B']/boot-status", "good"},
            {"[name='B']/installed", "2021-01-13T17:20:15Z"},
            {"[name='B']/name", "B"},
            {"[name='B']/state", "booted"},
            {"[name='B']/version", "v4-103-g34d2f48"},
        };
    }

    auto raucServer = DBusRAUCServer(*dbusServerConnection, "rootfs.1", dbusRaucStatus);
    auto sysrepo = std::make_shared<velia::system::Firmware>(srConn, *dbusClientConnectionSignals, *dbusClientConnectionMethods);

    REQUIRE(dataFromSysrepo(client, "/czechlight-system:firmware/firmware-slot", SR_DS_OPERATIONAL) == expected);
}
