This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packagemanage: Fix output of pacman config
When the config is dumped out for the docker-app manager, the custom config key/vals are printed val=key. eg: "/tmp/sota/docker-apps" = docker_apps_root This fixes the issue. Signed-off-by: Andy Doan <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/libaktualizr/package_manager/packagemanagerconfig_test.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include "libaktualizr/config.h" | ||
#include "logging/logging.h" | ||
|
||
TEST(PackageManagerConfig, WriteToStream) { | ||
PackageConfig config; | ||
config.os = "amiga"; | ||
config.fake_need_reboot = true; | ||
config.extra["foo"] = "bar"; | ||
std::stringstream out; | ||
config.writeToStream(out); | ||
std::string cfg = out.str(); | ||
|
||
ASSERT_NE(std::string::npos, cfg.find("os = \"amiga\"")); | ||
ASSERT_NE(std::string::npos, cfg.find("fake_need_reboot = 1")); | ||
ASSERT_NE(std::string::npos, cfg.find("foo = \"bar\"")); | ||
} | ||
|
||
#ifndef __NO_MAIN__ | ||
int main(int argc, char** argv) { | ||
::testing::InitGoogleTest(&argc, argv); | ||
return RUN_ALL_TESTS(); | ||
} | ||
#endif |