libzypp  17.38.17
TestcaseSetup.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
13 #ifndef ZYPP_MISC_TESTCASESETUP_H
14 #define ZYPP_MISC_TESTCASESETUP_H
15 
16 #include <zypp/Arch.h>
17 #include <zypp-core/Globals.h>
18 #include <zypp-core/base/Flags.h>
19 #include <zypp/Locale.h>
20 #include <zypp-core/Pathname.h>
21 #include <zypp/ResolverFocus.h>
22 #include <zypp-core/Url.h>
24 #include <zypp/base/SetTracker.h>
25 #include <zypp/sat/Queue.h>
27 
28 #include <map>
29 #include <optional>
30 #include <string>
31 #include <vector>
32 
33 namespace zypp {
34  class RepoManager;
35  class ResPool;
36 }
37 
38 namespace zypp::misc::testcase
39 {
40 
41  enum class TestcaseRepoType {
42  Helix,
43  Testtags,
44  Url
45  };
46 
47  struct RepoDataImpl;
48  struct ForceInstallImpl;
49  struct TestcaseSetupImpl;
50 
51  class RepoData {
52  public:
53  RepoData ();
54  ~RepoData ();
56  TestcaseRepoType type() const;
57  const std::string &alias() const;
58  uint priority() const;
59  const std::string &path() const;
60 
61  const RepoDataImpl &data() const;
62  RepoDataImpl &data();
63  private:
65  };
66 
68  public:
69  ForceInstall ();
70  ~ForceInstall ();
71  ForceInstall ( ForceInstallImpl &&data );
72  const std::string &channel () const;
73  const std::string &package () const;
74  const std::string &kind () const;
75 
76  const ForceInstallImpl &data() const;
77  ForceInstallImpl &data();
78  private:
80  };
81 
94  AS_SOLVER_FLAGS = (1 << 0),
95  AS_LOCALES = (1 << 1),
96  AS_AUTOINSTALLED = (1 << 2),
97  AS_VENDOR_LISTS = (1 << 3),
98  AS_MODALIAS = (1 << 4),
99  AS_MULTIVERSION = (1 << 5),
100  AS_LOCKS = (1 << 6),
101 
106  AS_ALL = ~0
107  };
109 
111  {
112  public:
114  using LockEntry = std::pair<std::string, std::map<std::string,std::string>>;
115 
116  TestcaseSetup();
117  ~TestcaseSetup();
118 
119  Arch architecture () const;
120 
121  const std::optional<RepoData> &systemRepo() const;
122  const std::vector<RepoData> &repos() const;
123 
124  // solver flags: default to false - set true if mentioned in <setup>
125  ResolverFocus resolverFocus() const;
126 
127  const Pathname &globalPath() const;
128  const Pathname &hardwareInfoFile() const;
129  const Pathname &systemCheck() const;
130 
131  const target::Modalias::ModaliasList &modaliasList() const;
132  const base::SetTracker<LocaleSet> &localesTracker() const;
133  const std::vector<std::vector<std::string>> &vendorLists() const;
134  const sat::StringQueue &autoinstalled() const;
135  const std::set<std::string> &multiversionSpec() const;
136  const std::vector<ForceInstall> &forceInstallTasks() const;
137  const std::vector<LockEntry> &locks() const;
138 
139  bool set_licence() const;
140  bool show_mediaid() const;
141 
142  bool ignorealreadyrecommended() const;
143  bool onlyRequires() const;
144  bool forceResolve() const;
145  bool cleandepsOnRemove() const;
146  bool noUpdateProvide() const;
147 
148  bool allowDowngrade() const;
149  bool allowNameChange() const;
150  bool allowArchChange() const;
151  bool allowVendorChange() const;
152 
153  bool dupAllowDowngrade() const;
154  bool dupAllowNameChange() const;
155  bool dupAllowArchChange() const;
156  bool dupAllowVendorChange() const;
157 
158  bool applySetup ( zypp::RepoManager &manager ) const;
159 
165  bool applySetup ( zypp::RepoManager &manager, ApplySetupFlags flags_r ) const;
166 
167  static bool loadRepo (zypp::RepoManager &manager, const TestcaseSetup &setup, const RepoData &data );
168 
169  TestcaseSetupImpl &data();
170  const TestcaseSetupImpl &data() const;
171 
172  private:
174  };
175 }
176 
177 
178 #endif // ZYPP_MISC_TESTCASESETUPIMPL_H
Only arch, repos, hardware-info (historic default)
Definition: TestcaseSetup.h:93
ApplySetupFlag
Bits controlling how much of the testcase setup is applied.
Definition: TestcaseSetup.h:92
Apply everything (full fidelity replay)
Architecture.
Definition: Arch.h:36
ResolverFocus
The resolver&#39;s general attitude.
Definition: ResolverFocus.h:23
const RepoDataImpl & data() const
_noUpdateProvide _allowvendorchange dupAllowNameChange
Definition: Resolver.cc:178
initRequestedLocales + setRequestedLocales
Definition: TestcaseSetup.h:95
RWCOW_pointer< TestcaseSetupImpl > _pimpl
ZYPP_DECLARE_FLAGS_AND_OPERATORS(ApplySetupFlags, ApplySetupFlag)
const std::string & path() const
Package universe without solver opinions: repos, locales, autoinstalled, vendor lists, modalias, multiversion, locks — but NOT solver flags.
_noUpdateProvide allowVendorChange
Definition: Resolver.cc:176
RWCOW_pointer< ForceInstallImpl > _pimpl
Definition: TestcaseSetup.h:79
creates and provides information about known sources.
Definition: RepoManager.cc:40
_noUpdateProvide _allowvendorchange _dup_allownamechange dupAllowVendorChange
Definition: Resolver.cc:180
Provides API related macros.
std::pair< std::string, std::map< std::string, std::string > > LockEntry
lock/keep node data extracted from trial nodes and applied as pool setup.
ZConfig multiversion spec.
Definition: TestcaseSetup.h:99
#define ZYPP_API_DEPTESTOMATIC
Definition: Globals.h:82
const std::string & alias() const
TestcaseRepoType type() const
Libsolv Id queue wrapper.
Definition: Queue.h:35
VendorAttr vendor-equivalence lists.
Definition: TestcaseSetup.h:97
Resolver flags, focus, DUP flags.
Definition: TestcaseSetup.h:94
lock/keep nodes extracted from trial nodes
std::vector< std::string > ModaliasList
Definition: Modalias.h:45
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
Url manipulation class.
Definition: Url.h:92
Resolvable::Kind kind
RW_pointer supporting &#39;copy on write&#39; functionality.
Definition: PtrTypes.h:468
RWCOW_pointer< RepoDataImpl > _pimpl
Definition: TestcaseSetup.h:64