Example #1
0
static int TestConnectivity() {
    using namespace test;

    Porto::Connection api;

    std::vector<std::string> containers;
    ExpectApiSuccess(api.List(containers));

    std::string name = "a";
    ExpectApiSuccess(api.Create(name));
    ExpectApiSuccess(api.Destroy(name));

    return 0;
}
Example #2
0
void WaitPortod(Porto::Connection &api, int times) {
    Say() << "Waiting for portod startup" << std::endl;

    std::vector<std::string> clist;
    do {
        if (times-- <= 0)
            break;

        usleep(1000000);

    } while (api.List(clist) != 0);

    if (times <= 0)
        throw std::string("Waited too long for portod startup");
}