Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from ancorgs/fix_cmdline_parsing
Fix cmdline parsing to support more situations (bnc#889241)
- Loading branch information
Showing
7 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ | |
"#\n", // comment | ||
true, // read-only | ||
(`List( | ||
`String("^ \n"), | ||
" " | ||
`String("^ \n\t"), | ||
`Separator(" \n\t") | ||
)) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
initrd=initrd splash=silent | ||
install=hd:/// biosdevname=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
initrd=initrd splash=silent install=hd:/// biosdevname=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
initrd=initrd splash=silent install=hd:/// biosdevname=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#! /usr/bin/rspec | ||
|
||
top_srcdir = File.expand_path("../../../..", __FILE__) | ||
inc_dirs = Dir.glob("#{top_srcdir}/library/*/src") | ||
ENV["Y2DIR"] = inc_dirs.join(":") | ||
|
||
require "yast" | ||
|
||
Yast.import "SCR" | ||
|
||
DEFAULT_DATA_DIR = File.join(File.expand_path(File.dirname(__FILE__)), "data") | ||
|
||
def set_root_path(directory) | ||
root = File.join(DEFAULT_DATA_DIR, directory) | ||
desc = Yast::WFM.SCROpen("chroot=#{root}:scr", false) | ||
Yast::WFM.SCRSetDefault(desc) | ||
end | ||
|
||
describe "SCR" do | ||
describe ".proc.cmdline" do | ||
describe "Read" do | ||
let(:expected_list) { %w(biosdevname=1 initrd=initrd install=hd:/// splash=silent) } | ||
let(:read_list) { Yast::SCR.Read(Yast::Path.new(".proc.cmdline")).sort } | ||
|
||
it "parses correctly simple files" do | ||
set_root_path("cmdline-simple") | ||
expect(read_list).to eq(expected_list) | ||
end | ||
|
||
it "parses correctly files with two separators" do | ||
set_root_path("cmdline-twoseparators") | ||
expect(read_list).to eq(expected_list) | ||
end | ||
|
||
it "parses correctly files with several lines" do | ||
set_root_path("cmdline-newlines") | ||
expect(read_list).to eq(expected_list) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
|
||
|
||
Name: yast2 | ||
Version: 3.1.88 | ||
Version: 3.1.89 | ||
Release: 0 | ||
URL: https://github.com/yast/yast-yast2 | ||
|
||
|