libzypp  17.25.1
LoadTestcase.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_MISC_LOADTESTCASE_H
13 #define ZYPP_MISC_LOADTESTCASE_H
14 
15 #include <zypp/Arch.h>
16 #include <zypp/Locale.h>
17 #include <zypp/Pathname.h>
18 #include <zypp/ResolverFocus.h>
19 #include <zypp/Url.h>
20 #include <zypp/base/PtrTypes.h>
21 #include <zypp/base/SetTracker.h>
22 #include <zypp/base/NonCopyable.h>
23 #include <zypp/sat/Queue.h>
25 
26 #include <optional>
27 #include <memory>
28 
29 namespace zypp {
30  class RepoManager;
31 }
32 
33 namespace zypp::misc::testcase {
34 
35  enum class TestcaseRepoType {
36  Helix,
37  Testtags,
38  Url
39  };
40 
41  struct RepoData {
43  std::string alias;
44  uint priority = 99;
45  std::string path;
46  };
47 
48  struct ForceInstall {
49  std::string channel;
50  std::string package;
51  std::string kind;
52  };
53 
55  {
56  Arch architecture = Arch_noarch;
57 
58  std::optional<RepoData> systemRepo;
59  std::vector<RepoData> repos;
60 
61  // solver flags: default to false - set true if mentioned in <setup>
63 
67 
71  std::set<std::string> multiversionSpec;
72  std::vector<ForceInstall> forceInstallTasks;
73 
74  bool set_licence = false;
75  bool show_mediaid = false;
76 
78  bool onlyRequires = false;
79  bool forceResolve = false;
80  bool cleandepsOnRemove = false;
81 
82  bool allowDowngrade = false;
83  bool allowNameChange = false;
84  bool allowArchChange = false;
85  bool allowVendorChange = false;
86 
87  bool dupAllowDowngrade = false;
88  bool dupAllowNameChange = false;
89  bool dupAllowArchChange = false;
90  bool dupAllowVendorChange = false;
91 
92  bool applySetup ( zypp::RepoManager &manager ) const;
93 
94  static bool loadRepo (zypp::RepoManager &manager, const TestcaseSetup &setup, const RepoData &data );
95  };
96 
98  {
99  struct Node {
100  std::string name;
101  std::string value;
102 
103  const std::string &getProp( const std::string &name, const std::string &def = std::string() ) const;
104 
105  std::map<std::string, std::string> properties;
106  std::vector<std::shared_ptr<Node>> children;
107  };
108  std::vector<Node> nodes;
109  };
110 
112  {
113  public:
114  struct Impl;
115 
116  enum Type {
120  };
121 
122  LoadTestcase();
123  ~LoadTestcase();
124 
125  bool loadTestcaseAt ( const zypp::Pathname &path, std::string *err );
126  static Type testcaseTypeAt ( const zypp::Pathname &path );
127 
128  const TestcaseSetup &setupInfo() const;
129  const std::vector<TestcaseTrial> &trialInfo() const;
130 
131  private:
132  std::unique_ptr<Impl> _pimpl;
133  };
134 
135 }
136 
137 
138 #endif // ZYPP_MISC_LOADTESTCASE_H
bool loadTestcaseAt(const zypp::Pathname &path, std::string *err)
static bool loadRepo(zypp::RepoManager &manager, const TestcaseSetup &setup, const RepoData &data)
std::map< std::string, std::string > properties
Definition: LoadTestcase.h:105
const TestcaseSetup & setupInfo() const
Architecture.
Definition: Arch.h:36
ResolverFocus
The resolvers general attitude.
Definition: ResolverFocus.h:21
std::vector< RepoData > repos
Definition: LoadTestcase.h:59
Request the standard behavior (as defined in zypp.conf or &#39;Job&#39;)
std::set< std::string > multiversionSpec
Definition: LoadTestcase.h:71
std::optional< RepoData > systemRepo
Definition: LoadTestcase.h:58
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
static Type testcaseTypeAt(const zypp::Pathname &path)
std::vector< ForceInstall > forceInstallTasks
Definition: LoadTestcase.h:72
const std::string & getProp(const std::string &name, const std::string &def=std::string()) const
std::vector< std::shared_ptr< Node > > children
Definition: LoadTestcase.h:106
base::SetTracker< LocaleSet > localesTracker
Definition: LoadTestcase.h:69
std::vector< std::string > ModaliasList
Definition: Modalias.h:41
Libsolv Id queue wrapper.
Definition: Queue.h:34
creates and provides information about known sources.
Definition: RepoManager.h:105
std::unique_ptr< Impl > _pimpl
Definition: LoadTestcase.h:132
bool applySetup(zypp::RepoManager &manager) const
target::Modalias::ModaliasList modaliasList
Definition: LoadTestcase.h:68
const std::vector< TestcaseTrial > & trialInfo() const
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
Url manipulation class.
Definition: Url.h:87