summaryrefslogtreecommitdiff
path: root/hscript/script_e.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 16:47:19 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-11-06 16:52:36 -0600
commite4d2dfda526402b1cd4623ea473ab655ea421de5 (patch)
treebf4e293dda2025366061f662a7890c3fbfa2df54 /hscript/script_e.cc
parentd3f9715777ee32b7c3d38f8b520597eea2d79a79 (diff)
downloadhorizon-e4d2dfda526402b1cd4623ea473ab655ea421de5.tar.gz
horizon-e4d2dfda526402b1cd4623ea473ab655ea421de5.tar.bz2
horizon-e4d2dfda526402b1cd4623ea473ab655ea421de5.tar.xz
horizon-e4d2dfda526402b1cd4623ea473ab655ea421de5.zip
tests: Add more nameserver behavioural tests
Diffstat (limited to 'hscript/script_e.cc')
-rw-r--r--hscript/script_e.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/hscript/script_e.cc b/hscript/script_e.cc
index b494698..32c1c69 100644
--- a/hscript/script_e.cc
+++ b/hscript/script_e.cc
@@ -432,12 +432,15 @@ bool Script::execute() const {
output_info("internal", "initialising APK");
if(opts.test(Simulate)) {
std::cout << "apk --root /target --initdb add" << std::endl;
- } else {
+ }
+#ifdef HAS_INSTALL_ENV
+ else {
if(system("apk --root /target --initdb add") != 0) {
EXECUTE_FAILURE("pkginstall");
return false;
}
}
+#endif /* HAS_INSTALL_ENV */
/* REQ: Runner.Execute.pkginstall */
output_info("internal", "installing packages to target");
@@ -448,7 +451,9 @@ bool Script::execute() const {
if(opts.test(Simulate)) {
std::cout << "apk --root /target update" << std::endl;
std::cout << "apk --root /target add " << pkg_list.str() << std::endl;
- } else {
+ }
+#ifdef HAS_INSTALL_ENV
+ else {
if(system("apk --root /target update") != 0) {
EXECUTE_FAILURE("pkginstall");
return false;
@@ -459,6 +464,7 @@ bool Script::execute() const {
return false;
}
}
+#endif /* HAS_INSTALL_ENV */
output_step_end("pkgdb");
@@ -476,7 +482,9 @@ bool Script::execute() const {
<< " /target/etc/runlevels/default/net." << iface
<< std::endl;
}
- } else {
+ }
+#ifdef HAS_INSTALL_ENV
+ else {
for(auto &iface : ifaces) {
fs::create_symlink("/etc/init.d/net.lo",
"/target/etc/init.d/net." + iface, ec);
@@ -494,6 +502,7 @@ bool Script::execute() const {
}
}
}
+#endif /* HAS_INSTALL_ENV */
}
if(!internal->rootpw->execute(opts)) {