From ada546b6002360169570a72c83fadc574b936c18 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 6 Nov 2019 00:57:00 -0600 Subject: hscript: Implement Runner.Execute.netaddress.OpenRC --- tests/fixtures/0200-netaddress-openrc.installfile | 6 ++++++ tests/spec/simulator_spec.rb | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/fixtures/0200-netaddress-openrc.installfile (limited to 'tests') diff --git a/tests/fixtures/0200-netaddress-openrc.installfile b/tests/fixtures/0200-netaddress-openrc.installfile new file mode 100644 index 0000000..5d3aee4 --- /dev/null +++ b/tests/fixtures/0200-netaddress-openrc.installfile @@ -0,0 +1,6 @@ +network true +netaddress eth0 static 2600:1702:2a80:1b9f:5bbc:af4c:5dd1:a183 64 +hostname test.machine.internal +pkginstall adelie-base openrc s6-linux-init netifrc +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/spec/simulator_spec.rb b/tests/spec/simulator_spec.rb index d46c87c..be684a1 100644 --- a/tests/spec/simulator_spec.rb +++ b/tests/spec/simulator_spec.rb @@ -174,6 +174,16 @@ printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/gwyn/source /usr/src auto noatime >> # The end quote is missing deliberately. expect(last_command_started.stdout).to include('routes_eth0="default via 172.16.1.1') end + it "doesn't perform OpenRC configuration when netifrc isn't installed" do + use_fixture '0042-netaddress-valid-static6.installfile' + run_simulate + expect(last_command_started.stdout).to_not include ("/target/etc/init.d/net") + end + it "performs OpenRC configuration when netifrc is installed" do + use_fixture '0200-netaddress-openrc.installfile' + run_simulate + expect(last_command_started.stdout).to include("ln -s /etc/init.d/net.lo /target/etc/init.d/net.eth0") + end end context "simulating 'nameserver' execution" do it "configures nameservers correctly" do -- cgit v1.2.3-70-g09d2