History log of /openbmc/openbmc-test-automation/lib/gen_valid.py (Results 1 – 25 of 32)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 20f38712 08-Dec-2022 Patrick Williams <patrick@stwcx.xyz>

black: re-format

black and isort are enabled in the openbmc-build-scripts on Python files
to have a consistent formatting. Re-run the formatter on the whole
repository.

Signed-off-by: Patrick Will

black: re-format

black and isort are enabled in the openbmc-build-scripts on Python files
to have a consistent formatting. Re-run the formatter on the whole
repository.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I944f1915ece753f72a3fa654902d445a9749d0f9

show more ...


# e635ddc0 08-Dec-2022 George Keishing <gkeishin@in.ibm.com>

Revert "black: re-format"

This reverts commit 5731818de0ce446ceaafc7e75ae39da1b69942ae.

Signed-off-by: George Keishing <gkeishin@in.ibm.com>
Change-Id: Ie61cdc8c7f2825b0d9d66be87a6a3a058de2b372


# 5731818d 08-Dec-2022 Patrick Williams <patrick@stwcx.xyz>

black: re-format

black and isort are enabled in the openbmc-build-scripts on Python files
to have a consistent formatting. Re-run the formatter on the whole
repository.

Change-Id: If1010ead857d413

black: re-format

black and isort are enabled in the openbmc-build-scripts on Python files
to have a consistent formatting. Re-run the formatter on the whole
repository.

Change-Id: If1010ead857d41364c024bf8145a979a9377d382
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


Revision tags: robotframework-requests
# e7e9171e 03-Sep-2021 George Keishing <gkeishin@in.ibm.com>

Update python code for python 3.8 or higher compatibility

Changes:
- Update shebang directive to use python3 explicitly.
- remove preexec_fn feature which is deprecated in

Update python code for python 3.8 or higher compatibility

Changes:
- Update shebang directive to use python3 explicitly.
- remove preexec_fn feature which is deprecated in higher
python version 3.8 and above.
- bufsize fix, from documentation bufsize 1 means line buffered
(only usable if universal_newlines=True i.e., in a text mode)
refer: https://docs.python.org/3/library/subprocess.html
- Fix SyntaxWarning: "is" with "=="

Change-Id: Ib96c1ba8c2327d6774d0d731b48ca7e61a4a297a
Signed-off-by: George Keishing <gkeishin@in.ibm.com>

show more ...


Revision tags: v2.10-Hardknott, v2.8.0-stable
# 2f88a81f 06-Apr-2020 Tony Lee <tony.lee@quantatw.com>

Fixed case 'Verify Set DateTime With Offset Using Redfish'

-Fixed method valid_range(), if lower is 0, this case won't
succeed.

Change-Id: I9aedd46650bfc3b46bf22ace08ff90be24e2

Fixed case 'Verify Set DateTime With Offset Using Redfish'

-Fixed method valid_range(), if lower is 0, this case won't
succeed.

Change-Id: I9aedd46650bfc3b46bf22ace08ff90be24e29577
Signed-off-by: Tony Lee <tony.lee@quantatw.com>

show more ...


# 81384420 20-Mar-2020 Michael Walsh <micwalsh@us.ibm.com>

gen_valid doc formatting fix

Change-Id: Ib34b51835b2b26b6475b3feb288dd1bbee6f0705
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>


# 8206851a 27-Feb-2020 George Keishing <gkeishin@in.ibm.com>

Typo and robot lint fix in code documentation

Change-Id: I5f06c3c40c94cf00b001cd1655e1e21a92f9fee3
Signed-off-by: George Keishing <gkeishin@in.ibm.com>


# 53902dd1 20-Feb-2020 Michael Walsh <micwalsh@us.ibm.com>

valid_dict support for invalid/valid_values

Added support to valid_dict() function for new valid_values and
invalid_values args.

- Also, minor correction to output text in valid

valid_dict support for invalid/valid_values

Added support to valid_dict() function for new valid_values and
invalid_values args.

- Also, minor correction to output text in valid_value().

Change-Id: I435538c6b989e1f3d5108be2afc6479ad32a91f7
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# 0f5fa532 13-Feb-2020 Michael Walsh <micwalsh@us.ibm.com>

Validation of list args for valid_values()

Added code to ensure that valid_values and invalid_values are lists.
If they are not, the user can get unexpected results.

Example:

Validation of list args for valid_values()

Added code to ensure that valid_values and invalid_values are lists.
If they are not, the user can get unexpected results.

Example:

var1 = 'enabled'
valid_value(var1, valid_values='enableddd')

In this case, valid_values is a string so when the function does this:

if var1 in valid_values:

The answer will be "yes" so will will get an incorrect validation.

The correct invocation should be this:

valid_value(var1, valid_values=['enableddd'])

Which correctly yields a failure:

var1: enabled <str>

It must be one of the following values:

valid_values: <list>
[0]: enableddd <str>

Change-Id: I2d10a00a4cc372af4c2eacc0dc33afbaa0ccf3a7
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# 8333a18d 22-Oct-2019 Michael Walsh <micwalsh@us.ibm.com>

New valid_float, valid_date_time functions

Change-Id: I844fed7bbaba4dd57a6c79d8b64ab96444ca8a36
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>


# da20f845 16-Oct-2019 Michael Walsh <micwalsh@us.ibm.com>

valid_list: enforce only one of three args

- valid_values allows only one of the following three arguments:
- valid_values
- invalid_values
- required_values
It was i

valid_list: enforce only one of three args

- valid_values allows only one of the following three arguments:
- valid_values
- invalid_values
- required_values
It was incorrectly enforcing this rule.

- Change to allow 110 chars vs. 79 chars for comments and docstrings.

Change-Id: Idcd3b27fa2445f22698365b81c1b96014d141d4d
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# 89eff544 13-Sep-2019 Michael Walsh <micwalsh@us.ibm.com>

gen_valid functions not failing bad args

- If a caller passed an invalid argument to a validation function,
no objection was made:

Valid Value var1 valid_value=['this']

gen_valid functions not failing bad args

- If a caller passed an invalid argument to a validation function,
no objection was made:

Valid Value var1 valid_value=['this']

In this example, valid_value is incorrect. It should be
valid_values.

With this fix, the program will fail with a message like this:

TypeError: valid_value() got an unexpected keyword argument
'valid_value'

Change-Id: Ie3c00ee1c23cc3e96502f12e11cae6e22471aaf1
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# b9d8dfd2 11-Sep-2019 Michael Walsh <micwalsh@us.ibm.com>

New valid_length and fix valid_range

- New valid_length function
- Also fixed some errors in valid_range

Change-Id: I1a9856ee796388d189060f9b860cd88ff3e9e16c
Signed-off-by:

New valid_length and fix valid_range

- New valid_length function
- Also fixed some errors in valid_range

Change-Id: I1a9856ee796388d189060f9b860cd88ff3e9e16c
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# 00244345 29-Aug-2019 Michael Walsh <micwalsh@us.ibm.com>

valid_path: use gp.blank() on print_var

valid_path, valid_dir_path and valid_file_path should use the gp.blank
formatting option when printing the variable with the invalid value.
It

valid_path: use gp.blank() on print_var

valid_path, valid_dir_path and valid_file_path should use the gp.blank
formatting option when printing the variable with the invalid value.
It makes it more obvious when the field is blank.

Change-Id: Iab113ffcd99cd97215aac619903765477ef0d1e8
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# be3a8150 20-Aug-2019 Michael Walsh <micwalsh@us.ibm.com>

New valid_program() function

Change-Id: I0ac45502b6a4e8a38d7ec4b18bdd9df8c995ca66
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>


# 35026be5 14-Aug-2019 Michael Walsh <micwalsh@us.ibm.com>

valid_list support invalid_values/required_values

Added support to valid_list function for 2 new arguments:

- invalid_values
- required_values

Also, corrected a few sma

valid_list support invalid_values/required_values

Added support to valid_list function for 2 new arguments:

- invalid_values
- required_values

Also, corrected a few small errors.

Change-Id: Iec161b32ab2fce30cd42aa77168a9814dc099ed0
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# 018e25fb 01-Aug-2019 Michael Walsh <micwalsh@us.ibm.com>

Overhaul of gen_valid.py

This includes the following features:

- Previously, the validation functions were created as pairs of
svalid/valid functions. For example, there was

Overhaul of gen_valid.py

This includes the following features:

- Previously, the validation functions were created as pairs of
svalid/valid functions. For example, there was an svalid_value
paired with a valid_value, an svalid_integer paired with a
valid_integer, etc. In this design, the "svalid" base function would
do the work of detecting a particular error, formulating an error
message and returning it. The "valid" wrapper function would call
upon its svalid counterpart and then process any error by printing an
error message, exiting the program, etc.

In the new design, the base function determines whether it ought to
simply return an error message or continue on to the error processing
(printing, failing, etc.). It does this by determining whether the
caller is assigning the output to a variable. If so, it simply
returns the error message.

- Docstrings have been standardized with several goals in mind:
- Making them easier to maintain in this program.
- Making them manipulatable by gen_robot_valid.py.
- Making them more palatable for use by robot's libdoc function.

- Since all of the validation functions' docstrings share a lot of
common text, the docstrings are manipulated after the function have
been defined. Namely, each one has a standard header pre-pended and a
standard footer appended to it.

- The validation functions' approach has been standardized so that all
of the functions look quite similar to each other except for the
actual error detection code.

- The validation functions have been re-worked for improved readability.

- valid_type(): New function.

- valid_range() changes:
valid_range previously accepted a valid_range string argument whose
format was "<lower>..<upper>". The valid_range argument has been
deprecated and replaced by 2 arguments: lower and upper.

Change-Id: I1d7c124abcd7675e9892a00757e5c482bf3746f8
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# f5b93d7a 23-Jul-2019 Michael Walsh <micwalsh@us.ibm.com>

Fix valid_value print of complex robot var

On error, this line...

Rvalid Value os_release_info['version_id']
... valid_values=['${install_version}']

Was print

Fix valid_value print of complex robot var

On error, this line...

Rvalid Value os_release_info['version_id']
... valid_values=['${install_version}']

Was printing the variable name as just ['version_id'] rather than
os_release_info['version_id'].

Change-Id: Idd9e268f9d73ac70477ab85eacc5a2392ab8507f
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


Revision tags: v2.7-warrior-stable
# 0d5f96a4 20-May-2019 Michael Walsh <micwalsh@us.ibm.com>

Fix print_var calls: new fmt, indent, etc.

Changed print_var calls to correctly use new arguments:
- fmt
- indent
- col1_width

Change-Id: If80088d5b69865074fd510421b9

Fix print_var calls: new fmt, indent, etc.

Changed print_var calls to correctly use new arguments:
- fmt
- indent
- col1_width

Change-Id: If80088d5b69865074fd510421b918da7fd8e874e
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


Revision tags: v2.6-thud-stable, v2.2-stable
# 10a4d98b 30-Oct-2018 Michael Walsh <micwalsh@us.ibm.com>

process_error_message(): exit(0) should be exit(1)

Change-Id: Iae815c296b93146098e1d78878d7cd7e8de57f99
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>


# 7ac5fd81 11-Oct-2018 Michael Walsh <micwalsh@us.ibm.com>

New valid_dict functions

New functions to fail and generate error messages if a given dictionary
does not contain all of the specified key fields.

Change-Id: I9cbc9a89468f61a424

New valid_dict functions

New functions to fail and generate error messages if a given dictionary
does not contain all of the specified key fields.

Change-Id: I9cbc9a89468f61a424e1cf2afa9bdcc7477b11bd
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# 7732c7e2 14-Aug-2018 Gunnar Mills <gmills@us.ibm.com>

Spelling fixes

Spelling errors found using github.com/lucasdemarchi/codespell
A tool to fix common misspellings.
This tool is licensed under GNU General Public License, version 2.

Spelling fixes

Spelling errors found using github.com/lucasdemarchi/codespell
A tool to fix common misspellings.
This tool is licensed under GNU General Public License, version 2.

Change-Id: Id20fef954fd977a307ba36dce5c8c7365aa96a6d
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# ca193993 02-Aug-2018 Michael Walsh <micwalsh@us.ibm.com>

New valid_list funcs

Also fixed some doc errors.

Change-Id: Iaa936bf59abaf5e948be83a3d7cc4a07582b4388
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>


Revision tags: v2.1-stable
# faafa9c5 27-Jun-2018 Michael Walsh <micwalsh@us.ibm.com>

Add fork arg to shell_cmd

- Add support for a fork argument to the shell_cmd function.
- Also, some minor comment formatting changes to other gen_x.py files.

Change-Id: I7155379

Add fork arg to shell_cmd

- Add support for a fork argument to the shell_cmd function.
- Also, some minor comment formatting changes to other gen_x.py files.

Change-Id: I71553793591086da2548d52dcac4d80e208755b0
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


# 004ad3c9 11-Jun-2018 Joy Onyerikwu <onyekachukwu.joy.onyerikwu@ibm.com>

Formatted python files to follow PEP 8 python code standards.

- Changed the python files in the openbmc-test-automation
directory to conform to python code style standards with

Formatted python files to follow PEP 8 python code standards.

- Changed the python files in the openbmc-test-automation
directory to conform to python code style standards with
the exception of E402 and E501.
- Resolves openbmc/openbmc-test-automation#1308

Change-Id: I109995c2d248f5a6bb2c0e3c76a6144c8f3aac2e
Signed-off-by: Joy Onyerikwu <onyekachukwu.joy.onyerikwu@ibm.com>
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>

show more ...


12