...
 
Commits (3)
......@@ -196,7 +196,7 @@
</formalpara>
<formalpara id="Runner.Validate.hostname.Begin">
<title>Runner.Validate.hostname.Begin</title>
<para>The system shall verify that the value for the <literal>hostname</literal> key begins with an alphabetical character.</para>
<para>The system shall verify that the value for the <literal>hostname</literal> key begins with an alphanumeric character.</para>
</formalpara>
<formalpara id="Runner.Validate.hostname.Length">
<title>Runner.Validate.hostname.Length</title>
......
......@@ -43,9 +43,9 @@ bool Hostname::validate() const {
bool any_failure = false;
std::string::size_type last_dot = 0, next_dot = 0;
if(!isalpha(this->_value[0])) {
if(!isalnum(this->_value[0])) {
any_failure = true;
output_error(pos, "hostname: must start with alphabetical character");
output_error(pos, "hostname: must start with alphanumeric character");
}
if(this->_value.size() > 320) {
......
......@@ -508,7 +508,7 @@ bool Horizon::Script::validate() const {
}
/* REQ: Runner.Validate.encrypt.Block */
if(opts.test(InstallEnvironment)) {
if(opts.test(InstallEnvironment) && !opts.test(ImageOnly)) {
#ifdef HAS_INSTALL_ENV
CHECK_EXIST_PART_LV(crypt->device(), "encrypt", crypt->where())
#endif /* HAS_INSTALL_ENV */
......@@ -528,7 +528,7 @@ bool Horizon::Script::validate() const {
seen_fses.insert(fs->device());
/* REQ: Runner.Validate.fs.Block */
if(opts.test(InstallEnvironment)) {
if(opts.test(InstallEnvironment) && !opts.test(ImageOnly)) {
#ifdef HAS_INSTALL_ENV
CHECK_EXIST_PART_LV(fs->device(), "fs", fs->where())
#endif /* HAS_INSTALL_ENV */
......@@ -550,7 +550,7 @@ bool Horizon::Script::validate() const {
}
/* REQ: Runner.Validate.mount.Block */
if(opts.test(InstallEnvironment)) {
if(opts.test(InstallEnvironment) && !opts.test(ImageOnly)) {
#ifdef HAS_INSTALL_ENV
CHECK_EXIST_PART_LV(mount->device(), "mount", mount->where())
#endif /* HAS_INSTALL_ENV */
......
......@@ -188,7 +188,7 @@ int main(int argc, char *argv[]) {
if(if_path == "-") {
/* Unix-style stdin specification */
my_script = Horizon::Script::load(std::cin, opts);
my_script = Horizon::Script::load(std::cin, opts, "/dev/stdin");
} else {
my_script = Horizon::Script::load(if_path, opts);
}
......
......@@ -136,7 +136,8 @@ RSpec.describe 'HorizonScript validation', :type => :aruba do
it "with non-alphabetical first character" do
use_fixture '0024-numeric-hostname.installfile'
run_validate
expect(last_command_started).to have_output(/error: .*hostname.*/)
expect(last_command_started).to have_output(PARSER_SUCCESS)
expect(last_command_started).to have_output(VALIDATOR_SUCCESS)
end
# Runner.Validate.hostname.Length
it "with >320 characters" do
......