Commit db0919c9 authored by Ramon Nou's avatar Ramon Nou
Browse files

Added creation of /tmp/guided.txt in the test

parent eb9c5095
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -14,11 +14,27 @@
#include <catch2/catch.hpp>
#include <fmt/format.h>
#include <global/rpc/distributor.hpp>
#include <fstream>

TEST_CASE( "Guided distributor Testing", "[Distributor]" ) {

    GIVEN( "A distributor" ) {

        std::ofstream o;
        o.open("/tmp/guided.txt");
        o << "/t.c01 0 3" << std::endl;
        o << "/t.c02 0 3" << std::endl;
        o << "/t.c01 1 3" << std::endl;
        o << "/t.c02 1 3" << std::endl;
        o << "/t.c01 2 3" << std::endl;
        o << "/t.c02 2 3" << std::endl;
        o << "/t.c03 1 3" << std::endl;
        o << "/t.c04 1 3" << std::endl;
        o << "/t.c05 1 3" << std::endl;
        o << "/t.c06 1 3" << std::endl;
        o << "/t.c07 1 3" << std::endl;
        o.close();

        auto d = gkfs::rpc::GuidedDistributor();

        REQUIRE( d.locate_data("/t.c01",1,10) == 3 );