Lines Matching defs:metadata

48 do_check(const std::string& expected, const atf::tests::vars_map& metadata,
51 const std::string actual = impl::check_requirements(metadata, config);
60 // Tests for the require.arch metadata property.
66 atf::tests::vars_map metadata;
67 metadata["require.arch"] = atf::config::get("atf_arch");
68 do_check("", metadata);
74 atf::tests::vars_map metadata;
75 metadata["require.arch"] = "__fake_arch__";
76 do_check("Requires the '__fake_arch__' architecture", metadata);
82 atf::tests::vars_map metadata;
83 metadata["require.arch"] = "__foo__ " + atf::config::get("atf_arch") +
85 do_check("", metadata);
91 atf::tests::vars_map metadata;
92 metadata["require.arch"] = "__foo__ __bar__ __baz__";
94 metadata);
98 // Tests for the require.config metadata property.
104 atf::tests::vars_map metadata, config;
105 metadata["require.config"] = "var1";
107 do_check("", metadata, config);
113 atf::tests::vars_map metadata, config;
114 metadata["require.config"] = "var1";
115 do_check("Required configuration variable 'var1' not defined", metadata,
122 atf::tests::vars_map metadata, config;
123 metadata["require.config"] = "var1 var2 var3";
127 do_check("", metadata, config);
133 atf::tests::vars_map metadata, config;
134 metadata["require.config"] = "var1 var2 var3";
137 do_check("Required configuration variable 'var2' not defined", metadata,
142 // Tests for the require.files metadata property.
147 atf::tests::vars_map metadata;
148 metadata["require.files"] = "/bin/ls";
149 do_check("", metadata);
154 atf::tests::vars_map metadata;
155 metadata["require.files"] = "/non-existent/foo";
156 do_check("Required file '/non-existent/foo' not found", metadata);
161 atf::tests::vars_map metadata;
162 metadata["require.files"] = "/bin/cp this-is-relative";
164 impl::check_requirements(metadata, no_config));
169 atf::tests::vars_map metadata;
170 metadata["require.files"] = "/bin/ls /bin/cp";
171 do_check("", metadata);
176 atf::tests::vars_map metadata;
177 metadata["require.files"] = "/bin/ls /non-existent/bar /bin/cp";
178 do_check("Required file '/non-existent/bar' not found", metadata);
183 atf::tests::vars_map metadata;
184 metadata["require.files"] = "/bin/cp also-relative";
186 impl::check_requirements(metadata, no_config));
190 // Tests for the require.machine metadata property.
196 atf::tests::vars_map metadata;
197 metadata["require.machine"] = atf::config::get("atf_machine");
198 do_check("", metadata);
204 atf::tests::vars_map metadata;
205 metadata["require.machine"] = "__fake_machine__";
206 do_check("Requires the '__fake_machine__' machine type", metadata);
212 atf::tests::vars_map metadata;
213 metadata["require.machine"] = "__foo__ " + atf::config::get("atf_machine") +
215 do_check("", metadata);
221 atf::tests::vars_map metadata;
222 metadata["require.machine"] = "__foo__ __bar__ __baz__";
224 metadata);
228 // Tests for the require.memory metadata property.
233 atf::tests::vars_map metadata;
234 metadata["require.memory"] = "1m";
235 do_check("", metadata);
240 atf::tests::vars_map metadata;
241 metadata["require.memory"] = "128t";
244 metadata);
252 atf::tests::vars_map metadata;
253 metadata["require.memory"] = "foo";
255 impl::check_requirements(metadata, no_config));
259 // Tests for the require.progs metadata property.
265 atf::tests::vars_map metadata;
266 metadata["require.progs"] = "cp";
267 do_check("", metadata);
273 atf::tests::vars_map metadata;
274 metadata["require.progs"] = "cp __non-existent__";
276 metadata);
282 atf::tests::vars_map metadata;
283 metadata["require.progs"] = "bin/cp";
285 impl::check_requirements(metadata, no_config));
291 atf::tests::vars_map metadata;
292 metadata["require.progs"] = "cp ls mv";
293 do_check("", metadata);
299 atf::tests::vars_map metadata;
300 metadata["require.progs"] = "mv ls __foo__ cp";
301 do_check("Required program '__foo__' not found in the PATH", metadata);
307 atf::tests::vars_map metadata;
308 metadata["require.progs"] = "ls cp ../bin/cp";
310 impl::check_requirements(metadata, no_config));
314 // Tests for the require.user metadata property.
320 atf::tests::vars_map metadata;
321 metadata["require.user"] = "root";
323 do_check("", metadata);
325 do_check("Requires root privileges", metadata);
331 atf::tests::vars_map metadata;
332 metadata["require.user"] = "unprivileged";
335 "configuration variable is not set", metadata);
337 do_check("", metadata);
343 atf::tests::vars_map metadata;
344 metadata["require.user"] = "nobody";
346 impl::check_requirements(metadata, no_config));