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