bdk: give StubOs.cwd a sane default.

util.GetProductDir() expects os.getcwd() to start with '/' or else it
may loop forever. This seems like a reasonable expectation (on Linux at
least) so adjust StubOs.cwd to comply.

This fixes an issue where in some cases climanager_unittest.BdkTest
would end up calling util.GetProductDir(), but a previous test had
replaced util.os with StubOs, leading to this infinite loop.

The real underlying problem is that manually monkey-patching over
imported modules is super unpredictable and brittle, but that will have
to be addressed in a larger test overhaul.

Bug: 28602169
Change-Id: I5eda7e55b704933272f97a4334d7a92d18a0f6fa
Test: `python test_runner.py`, with and without randomized test order.
1 file changed
tree: 155ed32eca70773c0d09632513d0b6c7a9a087a8
  1. brunch/
  2. build/
  3. cli/
  4. debugging/
  5. pkgconfig/
  6. schema/
  7. .gitignore
  8. Android.mk
  9. CHANGES.md
  10. MODULE_LICENSE_APACHE2
  11. NOTICE
  12. PREUPLOAD.cfg
  13. README.md
  14. VERSION
README.md

The Brillo Developer Kit (BDK)

This is the bdk which is used to build Brillo.

Directory Listing

  • cli/: The main body of code that makes up the bdk tool.
  • schema/: Specification for the user's project.xml files.
  • CHANGES: A log highlighting major features across releases.
  • VERSION: This file should be the source of truth of the version number for a checkout. It will be updated by Builders and used by tools needing version information.