From f04b3f589d7800653b9fb3ad08131f4edd2e2828 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 18 Mar 2020 21:34:25 -0500 Subject: hscript: Support creation of /etc/network/interfaces --- tests/fixtures/0227-netconfigtype-eni.installfile | 4 ++-- tests/spec/simulator_spec.rb | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/fixtures/0227-netconfigtype-eni.installfile b/tests/fixtures/0227-netconfigtype-eni.installfile index 2eb6712..e5beb22 100644 --- a/tests/fixtures/0227-netconfigtype-eni.installfile +++ b/tests/fixtures/0227-netconfigtype-eni.installfile @@ -1,8 +1,8 @@ -hostname horizon-netifrc-test +hostname horizon-eni-test rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ network true netconfigtype eni -netaddress eth0 dhcp +netaddress eth0 static 192.168.1.2 24 192.168.1.1 netaddress eth0 slaac nameserver 9.9.9.10 diskid /dev/sda QEMU_HARDDISK diff --git a/tests/spec/simulator_spec.rb b/tests/spec/simulator_spec.rb index 66f1d8f..9d41356 100644 --- a/tests/spec/simulator_spec.rb +++ b/tests/spec/simulator_spec.rb @@ -213,6 +213,16 @@ printf '%s\\t%s\\t%s\\t%s\\t0\\t0\\n' /dev/gwyn/source /usr/src auto noatime >> run_simulate expect(last_command_started.stdout).to include("ln -s /etc/init.d/net.lo /target/etc/init.d/net.eth0") end + it "configures IPv4 addressing correctly with eni" do + use_fixture '0227-netconfigtype-eni.installfile' + run_simulate + expect(last_command_started.stdout).to include("auto eth0\niface eth0 inet static") + end + it "configures IPv6 SLAAC addressing correctly with eni" do + use_fixture '0227-netconfigtype-eni.installfile' + run_simulate + expect(last_command_started.stdout).to include("iface eth0 inet6 manual") + end end context "simulating 'nameserver' execution" do it "configures nameservers correctly" do -- cgit v1.2.3-60-g2f50