summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/0074-hostname-large.installfile5
-rw-r--r--tests/spec/simulator.rb17
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