Aktualizr
C++ SOTA Client
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
get_test.cc
1 #include <gtest/gtest.h>
2 
3 #include <boost/process.hpp>
4 
5 #include "get.h"
6 #include "test_utils.h"
7 
8 static std::string server = "http://127.0.0.1:";
9 
10 TEST(aktualizr_get, good) {
11  Config config;
13  config.storage.path = dir.Path();
14 
15  std::string body = aktualizrGet(config, server + "/path/1/2/3");
16  EXPECT_EQ("{\"path\": \"/path/1/2/3\"}", body);
17 }
18 
19 #ifndef __NO_MAIN__
20 int main(int argc, char **argv) {
21  ::testing::InitGoogleTest(&argc, argv);
22 
23  std::string port = TestUtils::getFreePort();
24  server += port;
25  boost::process::child server_process("tests/fake_http_server/fake_test_server.py", port);
26  TestUtils::waitForServer(server + "/");
27  return RUN_ALL_TESTS();
28 }
29 #endif
Config
Configuration object for an aktualizr instance running on a primary ECU.
Definition: config.h:73
TemporaryDirectory
Definition: utils.h:82