Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion live/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ build: $(DESTDIR)
(cd $(DESTDIR) && osc -A $(OBS_API) build -M $(FLAVOR) $(OSC_OPTS) $(OBS_TARGET) $(ARCH) $(KIWI_FILE))

check:
for i in ./test/*_test.*; do $${i}; done
for i in ./test/*_test.*; do $${i} || exit 1; done

.PHONY: build all clean
4 changes: 2 additions & 2 deletions live/root/usr/bin/info-cmdline-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# Script that expand agama.info parameter by downloading its file and appending it to agama.conf
# the info content is stored in info.conf

set -e
set -ex

TARGET="${1:-/run/agama/cmdline.d/agama.conf}"
INFO_CONTENT="${2:-/run/agama/cmdline.d/info.conf}"

expand_info_arg() {
INFO_URL=$(sed -n 's/\(.*[[:space:]]\|^\)\(inst\|agama\)\.info=\([^[:space:]]\+\).*/\2/p' "$TARGET")
INFO_URL=$(sed -n 's/\(.*[[:space:]]\|^\)\(inst\|agama\)\.info=\([^[:space:]]\+\).*/\3/p' "$TARGET")
if [ -z "${INFO_URL}" ]; then
return 0
fi
Expand Down
11 changes: 4 additions & 7 deletions live/test/info_cmdline_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /usr/bin/rspec
require "tmpdir"
require "cheetah"

describe "info-cmdline-conf.sh" do
let(:script_path) { File.expand_path("../root/usr/bin/info-cmdline-conf.sh", __dir__, ) }
Expand All @@ -14,13 +15,11 @@
target_path = File.join(tmpdir, "cmdline")
FileUtils.cp(source_path, target_path)
info_path = File.join(tmpdir, "cmdline.info")
command = "#{script_path} #{target_path} #{info_path}"
cmd_result = system(command)
expect(cmd_result).to eq true
Cheetah.run(script_path, target_path, info_path)
expected = File.read(expected_path)
result = File.read(target_path)
expect(result).to eq expected
expect(File.exists?(info_path)).to eq false
expect(File.exist?(info_path)).to eq false
end
end
end
Expand All @@ -35,9 +34,7 @@
target_path = File.join(tmpdir, "cmdline")
FileUtils.cp(source_path, target_path)
info_path = File.join(tmpdir, "cmdline.info")
command = "#{script_path} #{target_path} #{info_path}"
cmd_result = system(command)
expect(cmd_result).to eq true
Cheetah.run(script_path, target_path, info_path)
expected = File.read(expected_path)
result = File.read(target_path)
expect(result).to eq expected
Expand Down