22 lines
904 B
C++
22 lines
904 B
C++
// Route: GET /doos/status (containers, images, davmounts, version)
|
|||
|
|
#include "support/Assert.hpp"
|
||
|
|
#include "support/DoosHome.hpp"
|
||
|
|
|
||
|
|
using namespace molo::example::test;
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
ScratchDoosHome home("status");
|
||
|
|
Fixture f;
|
||
|
|
auto res = f.client->get("/doos/status");
|
||
|
|
check(res.status == 200, "status 200");
|
||
|
|
check(contains(res.body, "\"containers\":[]"), "no containers yet");
|
||
|
|
check(contains(res.body, "\"davmounts\":[]"), "no davmounts yet");
|
||
|
|
check(contains(res.body, "\"version\":\"1.6.0\""), "libdoos version");
|
||
|
|
check(contains(res.body, "\"name\":\"alpine\""), "catalog lists alpine");
|
||
|
|
auto made = f.client->post("/doos/create", "name=db1", "application/x-www-form-urlencoded");
|
||
|
|
check(made.status == 200, "create 200");
|
||
|
|
auto after = f.client->get("/doos/status");
|
||
|
|
check(contains(after.body, "\"name\":\"db1\""), "status shows the container");
|
||
|
|
return finish("doos/status");
|
||
|
|
}
|