Commit Graph

16 Commits

Author SHA1 Message Date
Dan Scott 0e8192cfd0 Move files to library folder 2024-03-22 14:26:59 -07:00
Nathaniel Mitchell e3b4473bad Update assertRegexpMatch to assertRegex and base Helper to NoneHelper
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-08-21 16:36:12 -07:00
Nathaniel Mitchell 483f9d99f6 Update unittests to match config parsing update
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-07-28 09:34:00 -07:00
Nathaniel Mitchell 0016b0c14c Clean up oshelper
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2023-05-26 18:32:51 -07:00
Frinzell, Aaron fbde218dff Update tests for decoupling parse_arg()
Signed-off-by: Frinzell, Aaron <aaron.frinzell@intel.com>
2022-12-05 12:16:00 -06:00
Nathaniel Mitchell 291632c0ee Apply flake8 code formatting rules against repo
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2022-07-28 09:17:10 -07:00
Nathaniel Mitchell c8c14e21be Remove shebang from all but the entry points. Update ep to py3
Signed-off-by: Nathaniel Mitchell <nathaniel.p.mitchell@intel.com>
2021-08-12 08:27:33 -07:00
Nicolas Iooss b4dd4ed572 Always close the temporary log file when a test fails
When running "python setup.py test" on Windows, the following failure is
reported:

    ======================================================================
    ERROR: test_platform_invalid (tests.software.test_cs.TestPlatformChipsecCs)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "d:\a\chipsec\chipsec\tests\software\cs.py", line 46, in tearDown
        os.remove(self.log_file)
    PermissionError: [WinError 32] The process cannot access the file
    because it is being used by another process:
    'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpg5_6bcaz'

This is because when `_cs.init()` (in `tests/software/cs.py`) throws an
exception, the temporary log file is not closed. Then the function
`TestChipsecUtil.tearDown` attempts to remove the temporary file with
`os.remove(self.log_file)` and it fails, as it is still used by the
logger.

Fix this by putting `_cs.init()` inside a `try`/`finally` construction
which always calls `logger.logger().close()` when an exception happens.

While at it, use `with open(...) as log` instead of `log.open()` +
`log.close()`, which is a more usual way of reading files in Python.
2021-04-30 14:54:01 -07:00
brentholtsclaw f7fe1be074 More whitespace cleanup
E231, E201, E226

Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
2020-07-31 13:46:13 -07:00
BrentHoltsclaw ada230b839 Fix unittest errors
Updated mock_helper to use BaseHelper
Updated util harness to correctly override helper with testhelper

Signed-off-by: BrentHoltsclaw <brent.holtsclaw@intel.com>
2019-11-18 15:10:56 -08:00
BrentHoltsclaw 0f7f48f404 Fixup unit tests based upon chipsec_util changes
Signed-off-by: BrentHoltsclaw <brent.holtsclaw@intel.com>
2019-09-03 22:27:57 -07:00
BrentHoltsclaw 2efeda4345 Merge python3-rc2 branch into master (#656) 2019-08-15 14:11:20 -07:00
c7zero d024dc6169 Added command-line options support to chipsec_util (#158)
* Added command-line options support to chipsec_util

* Fixed util test
2017-03-02 02:10:14 -08:00
abazhaniuk c377a72e28 Deb package (#135)
* merge

* Add Debian packaging

* cleanup

* Removed incorrect info into Copyright.

* One more: removed incorrect info in Copyright.
2017-01-06 12:57:13 -08:00
Thiébaud Weksteen b13f85b16f Add unittest.main() to each tests (#127) 2016-11-22 18:09:59 -08:00
Thiébaud Weksteen ead6e96222 Split util tests into multiple source files (#122) 2016-11-17 22:34:37 -08:00