Aktualizr
C++ SOTA Client
All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
ostree_mock.cc
1 #include <cstdlib>
2 
3 #include <ostree.h>
4 
5 extern "C" OstreeDeployment *ostree_sysroot_get_booted_deployment(OstreeSysroot *self) {
6  (void)self;
7  static OstreeDeployment *deployment;
8 
9  if (deployment != nullptr) {
10  return deployment;
11  }
12 
13  const char *hash = getenv("OSTREE_HASH");
14  deployment = ostree_deployment_new(0, "dummy-os", hash, 1, hash, 1);
15  return deployment;
16 }
17 
18 extern "C" const char *ostree_deployment_get_csum(OstreeDeployment *self) {
19  (void)self;
20  return getenv("OSTREE_HASH");
21 }