Commit Graph

141 Commits

Author SHA1 Message Date
Xavier Delaruelle
44c42fb8d7 ts: test module-help modulefile command
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2025-03-30 14:25:33 +02:00
Xavier Delaruelle
67c2b6b9b6 doc/ts: add "modules_release" internal state
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2025-03-29 19:10:54 +01:00
Xavier Delaruelle
ed17988e94 Fix interp variable reset between evaluations
Fix interpreter variable reset between multiple modulefile or modulerc
evaluations when variable initial value is an invalid list.

Fixes #570

Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2025-02-16 16:43:59 +01:00
Xavier Delaruelle
c6f72912ef ts: improve coverage of getModulefileFromLoadingModule proc 2024-11-10 20:40:16 +01:00
Xavier Delaruelle
b145e02f7d ts: improve coverage of getLoadedPrereqPath proc 2024-11-10 20:40:16 +01:00
Xavier Delaruelle
111ddf3f7b ts: improve coverage of changeContextOfModuleEval proc 2024-10-11 08:30:56 +02:00
Xavier Delaruelle
5e2292b4bb ts: add test to improve getModuleFromEvalId coverage 2024-10-11 08:30:56 +02:00
Xavier Delaruelle
08d81f59b8 Make "resource temporarily unavailable" an external error
Do not add Modules issue report web link when facing a "resource
temporarily unavailable" error when forking sub-process like logger or
pager.

Fixes #546
2024-09-20 19:27:12 +02:00
Xavier Delaruelle
989aa90975 ts: add tests where issue report link is skipped 2024-06-13 05:44:12 +02:00
Xavier Delaruelle
9aa5f9d948 ts: adapt source-sh results if mogui is defined prior tests 2024-06-12 06:43:01 +02:00
Xavier Delaruelle
0c6a8c8e92 Revert "ts: cover getpwuid failure in InitStateUsergroupsObjCmd"
Remove coverage test for the moment. CI Darwin environment (image sonoma
on Cirrus CI platform) requires injected library to be built for arm64e
architecture, however current environment build arm64 content, not
arm64e.
2024-05-12 14:46:43 +02:00
Xavier Delaruelle
3f6d35798e ts: cover getpwuid failure in InitStateUsergroupsObjCmd
Add test to cover failure of getpwuid in InitStateUsergroupsObjCmd C
function on Darwin system.
2024-05-12 14:46:36 +02:00
Xavier Delaruelle
097b1dc13f Revert "lib: use getgrouplist to fetch user's groups"
Revert use of getgrouplist C function instead of getgroups. getgrouplist
returns a result different than the one obtained with "id" command on
some OSes (FreeBSD, Cygwin, MSYS).

Stay with getgroups for the moment, as it is still the standard way
(POSIX.1-2008) to retrieve user groups.
2024-05-11 16:22:54 +02:00
Xavier Delaruelle
258a392620 lib: use getgrouplist to fetch user's groups
Update Envmodules_InitStateUsergroupsObjCmd to rely on getgrouplist C
function rather getgroups. getgrouplist seems to be a more modern
function to get user's groups. It automatically includes primary group
if not part of supplementary groups. No duplicate result are returned.
2024-05-11 16:21:58 +02:00
Xavier Delaruelle
00e8d8c911 lib: call getgroups to determine number of groups
Update Envmodules_InitStateUsergroupsObjCmd to make a first dummy call
to "getgroups" function in order to retrieve the number of groups and
then be able to allocate the right array size.

With such change, our function does not rely anymore on sysconf function
and on NGROUPS_MAX and DEFAULT_MAXGROUPS defines.
2024-05-11 16:21:38 +02:00
Xavier Delaruelle
22f35f2b76 ts: test bash-eval mode of sh-to-mod command 2024-02-07 20:48:58 +01:00
Xavier Delaruelle
2109bc32df ts: add test to improve getModuleFromLoadingModulefile proc coverage 2024-01-19 06:54:21 +01:00
Xavier Delaruelle
a16c40f0fa ts: add test to improve getLoadingModulefileList proc coverage 2024-01-19 06:54:21 +01:00
Xavier Delaruelle
acfb4f24c5 ts: add test to improve getInterpVar proc coverage 2024-01-19 06:54:21 +01:00
Xavier Delaruelle
c42f3aa155 Fix inconsistent modulefile state stack
Fix wrong modulefile state initialization introduced by 261970ce.
2024-01-19 06:54:21 +01:00
Xavier Delaruelle
e8e3c7e1e4 ts: adapt test after modulefile read code split 2023-11-27 20:19:05 +01:00
Xavier Delaruelle
1db0f882d0 Rework loading module conflict property serialization
Remove serialization code from getLoadedConflict to use dedicated
serializeModulePropertyValue procedure.
2023-10-01 08:41:41 +02:00
Xavier Delaruelle
add05b06a2 Add value kind attribute in config option definition array
Update configuration option definition array (g_config_defs) to add
value kind attribute as 4th entry in definition list. This attribute has
following possible values: 'i' for integer, 's' for string, 'b' for
boolean, 'l' for colon-separated list, 'o' for other.
2023-05-09 06:36:10 +02:00
Xavier Delaruelle
a0ccb6535d Record avail mods matching mod spec when parsing it
Update module specification parsing mechanism to add a getavails
argument. It indicates that available modules matching spec should be
searched in enabled modulepaths to record them in module version
specification structure.

When searching for available matching modules, disable extra match
search to avoid an infinite resolution loop.
2023-04-27 21:04:07 +02:00
Xavier Delaruelle
0fc8ac2bd4 Raise error when extra spec on non-search cmds
Extra specification in module search query is only allowed on search
sub-commands (avail, paths, whatis). An error is raised when parsing a
module specification if it contains an extra specification on a
non-search context.

xtspec argument is added to parseModuleSpecification procedure to know
if extra specification is allowed or not.
2023-04-27 21:04:07 +02:00
Xavier Delaruelle
d6e0afc2ed Allow module spec without name on several subcmds
Allow module specification with variant definition and no module name
version for avail, list, paths and whatis sub-commands.
2023-04-27 21:02:51 +02:00
Xavier Delaruelle
98af688203 Catch collection dir error and report correct msg
Fixes #482
2023-01-16 19:43:04 +01:00
Xavier Delaruelle
70b06e4160 ts: adapt tests to specific cache read code 2022-12-27 18:43:58 +01:00
Xavier Delaruelle
ab00e46398 ts: add/update cachebuild tests with real cache file 2022-12-24 17:24:52 +01:00
Xavier Delaruelle
56085aac99 ts: add initial cachebuild sub-cmd tests 2022-11-30 08:07:12 +01:00
Xavier Delaruelle
dca45423d1 ts: add cacheclear sub-cmd tests 2022-11-28 03:58:56 +01:00
Xavier Delaruelle
3a8a249ac6 ts: test specific vars/cmds hooks in 50/560 2022-11-01 20:30:43 +01:00
Xavier Delaruelle
43beec6df5 Add start_idx argument on displayElementList
Add start_idx argument on displayElementList procedure to define what is
the starting index for the elements to report.
2022-10-02 14:26:28 +02:00
Xavier Delaruelle
b876754e98 Add notset_equals_empty arg to getDiffBetweenArray
Update getDiffBetweenArray procedure to add notset_equals_empty argument
(disabled by default). When enabled not-set element in array is
equivalent to element set to an empty value.
2022-09-28 06:42:59 +02:00
Xavier Delaruelle
b3c43f06bb ts: test 'module restore' without arg in initrc 2022-08-25 08:10:01 +02:00
Xavier Delaruelle
87d23931e6 ts: add reset sub-cmd tests 2022-08-25 08:10:01 +02:00
Xavier Delaruelle
e8c6b9db6e ts: add autoinit tests for __MODULES_LMINIT 2022-08-25 08:10:01 +02:00
Xavier Delaruelle
16a152506e ts: test module over a removed current working dir 2022-05-21 18:39:00 +02:00
Xavier Delaruelle
351eef8dc9 ts: test removal of alias/func/comp from source-sh script 2022-05-08 10:02:19 +02:00
Xavier Delaruelle
5d35d3940b ts: add readCollectionContent coverage test 2022-05-04 07:38:12 +02:00
Xavier Delaruelle
629637d118 ts: add unsetModuleTag/unsetModuleExtraTag coverage test 2022-05-03 16:25:49 +02:00
Xavier Delaruelle
ea90b93d25 ts: fix 50/400 tests when module was defined but uninstalled
Correct source-sh tests in 50/400 to succeed when tests are run in an
environment where module is defined but has been uninstalled. It
corresponds to the environment created for 'mrel' script execution.
2022-05-03 09:55:50 +02:00
Xavier Delaruelle
e45eb859a1 ts/lib: test tcl ext lib against a failed sysconf call
Add an utility library that supersedes the sysconf function from libc.
The sysconf function from this added library always returns an error
(-1). It is used for coverage test of the sysconf call made within the
Envmodules_InitStateUsergroupsObjCmd function of the Tcl extension
library.
2022-03-31 13:06:26 +02:00
Xavier Delaruelle
7ddba79233 ts: test fish complete def without -c when fish>=3.2
Test fish shell completion definition without -c/--complete option when
fish is >=3.2 instead of >=3.0.
2022-02-25 14:03:40 +01:00
Xavier Delaruelle
cd4015b106 Revert work on noglob_eval_shells config option
Remove entirely the work on the noglob_eval_shells option as enclosing
in quotes the generated output of modulecmd.tcl to pass it to the eval
command is equivalent to disable the pathname expansion mechanism of
sh-kind shells.
2022-02-24 18:24:47 +01:00
Xavier Delaruelle
695238dbf8 ts: test wildcard char in func on sh-to-mod tests 2022-02-24 12:19:57 +01:00
Xavier Delaruelle
58ea6e8224 ts: test wildcard char in envvar on sh-to-mod tests 2022-02-24 11:24:33 +01:00
Xavier Delaruelle
344df27801 ts: test sh-to-mod against fish nested func/_ in name 2022-02-21 08:40:46 +01:00
Xavier Delaruelle
c80f663356 ts: test noglob_eval_shells over autoinit subcmd 2022-02-19 15:56:44 +01:00
Dimitri Papadopoulos
e9a6678eec Fix typos found by codespell 2022-02-15 05:54:03 +01:00