diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-14 12:26:55 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-10-14 12:26:55 -0500 |
commit | 036eb19b5825cbcd111420032e6291a10384a275 (patch) | |
tree | 3939d9cb814a6b9d7ba2dcabdd633568db12cc1b /tests | |
parent | 6847b25a62d320b6b7f050b88a2ab27e1ecd91cb (diff) | |
download | horizon-036eb19b5825cbcd111420032e6291a10384a275.tar.gz horizon-036eb19b5825cbcd111420032e6291a10384a275.tar.bz2 horizon-036eb19b5825cbcd111420032e6291a10384a275.tar.xz horizon-036eb19b5825cbcd111420032e6291a10384a275.zip |
tests: Add tests for hostname simulation
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/0074-hostname-large.installfile | 5 | ||||
-rw-r--r-- | tests/spec/simulator.rb | 17 |
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/fixtures/0074-hostname-large.installfile b/tests/fixtures/0074-hostname-large.installfile new file mode 100644 index 0000000..285fef1 --- /dev/null +++ b/tests/fixtures/0074-hostname-large.installfile @@ -0,0 +1,5 @@ +network false +hostname heartbreak-is-the-national-anthem.we-sing-it-proudly.new-romantics.club +pkginstall adelie-base +rootpw $6$gumtLGmHwOVIRpQR$2M9PUO24hy5mofzWWf9a.YLbzOgOlUby1g0hDj.wG67E2wrrvys59fq02PPdxBdbgkLZFtjfEx6MHZwMBamwu/ +mount /dev/sda1 / diff --git a/tests/spec/simulator.rb b/tests/spec/simulator.rb index 25d48f3..d3d8afa 100644 --- a/tests/spec/simulator.rb +++ b/tests/spec/simulator.rb @@ -33,7 +33,7 @@ RSpec.describe 'HorizonScript Simulator', :type => :aruba do expect(last_command_started.stdout).to start_with("#!/bin/sh") end end - context "simulating 'mount' flags" do + context "simulating 'mount' execution" do it "mounts directories in tree order" do use_fixture '0057-many-mounts.installfile' run_simulate @@ -44,4 +44,19 @@ mount /dev/sda2 /target/usr mount /dev/gwyn/source /target/usr/src") end end + context "simulating 'hostname' execution" do + it "sets the hostname properly" do + use_fixture '0074-hostname-large.installfile' + run_simulate + expect(last_command_started.stdout).to include("hostname heartbreak-is-the-national-anthem") + use_fixture '0001-basic.installfile' + run_simulate + expect(last_command_started.stdout).to include("hostname test.machine") + end + it "sets the domain name properly" do + use_fixture '0074-hostname-large.installfile' + run_simulate + expect(last_command_started.stderr).to include("set domain name 'we-sing-it-proudly.new-romantics.club'") + end + end end |