Skip to content
Open
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
4 changes: 4 additions & 0 deletions docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ System Configuration
A list of environment variables to be set always when running on this system.
These variables modify the ReFrame environment.
Each environment variable is specified as a two-element list containing the variable name and its value.
The variable name must be a valid POSIX shell name: it may contain only alphanumeric characters and underscores (``_``) and must not start with a digit.
You may reference other environment variables when defining an environment variable here.
ReFrame will expand its value.
Variables are set after the environment modules are loaded.
Expand Down Expand Up @@ -699,6 +700,7 @@ System Partition Configuration

A list of environment variables to be set before running a regression test on this partition.
Each environment variable is specified as a two-element list containing the variable name and its value.
The variable name must be a valid POSIX shell name: it may contain only alphanumeric characters and underscores (``_``) and must not start with a digit.
You may reference other environment variables when defining an environment variable here.
ReFrame will expand its value.
Variables are set after the environment modules are loaded.
Expand Down Expand Up @@ -875,6 +877,7 @@ ReFrame can launch containerized applications, but you need to configure properl

List of environment variables to be set when running containerized tests using this container platform.
Each environment variable is specified as a two-element list containing the variable name and its value.
The variable name must be a valid POSIX shell name: it may contain only alphanumeric characters and underscores (``_``) and must not start with a digit.
You may reference other environment variables when defining an environment variable here.
ReFrame will expand its value.
Variables are set after the environment modules are loaded.
Expand Down Expand Up @@ -1004,6 +1007,7 @@ They are associated with `system partitions <#system-partition-configuration>`__

A list of environment variables to be set when loading this environment.
Each environment variable is specified as a two-element list containing the variable name and its value.
The variable name must be a valid POSIX shell name: it may contain only alphanumeric characters and underscores (``_``) and must not start with a digit.
You may reference other environment variables when defining an environment variable here.
ReFrame will expand its value.
Variables are set after the environment modules are loaded.
Expand Down
4 changes: 2 additions & 2 deletions reframe/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"type": "array",
"items": {
"type": "array",
"items": [{"$ref": "#/defs/alphanum_ext_string"}],
"additionalProperties": false
"items": [{"$ref": "#/defs/alphanum_string"}, {}],
"additionalItems": false
}
},
"modules_list": {
Expand Down
13 changes: 13 additions & 0 deletions unittests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,19 @@ def test_validate_config_invalid_syntax():
site_config.validate()


def test_validate_config_env_vars_name():
# Environment variable names must be POSIX shell names; a name containing
# a `-` must be rejected (see GH #<issue>).
site_config = config.load_config('reframe/core/settings.py')
site_config['systems'][0]['env_vars'] = [['FOO_BAR', 1]]
site_config.validate()

site_config['systems'][0]['env_vars'] = [['FOO-BAR', 1]]
with pytest.raises(ConfigError,
match=r'could not validate configuration file'):
site_config.validate()


def test_select_subconfig_autodetect():
site_config = config.load_config('reframe/core/settings.py')
site_config.select_subconfig()
Expand Down
Loading