Skip to content

Commit

Permalink
Add support for bind mount options and clean up connector tests (#52)
Browse files Browse the repository at this point in the history
* Fix #46 Support for volumes with 3 parts

Signed-off-by: Thibault Guittet <88336850+rh-tguittet@users.noreply.github.com>

* Reposition the t.Cleanup() invocations so that they might have a chance of being useful
  if the test actually fails or crashes.
* Remove the various timing Sleep() calls and replace them with loops which wait for the
  required datum to appear; this addresses at least one of the flakey tests which was failing
  occasionally in the CI.
* Fix a bug in TestCgroupNsByNamespacePath() where we were fetching the same datum
  twice and checking that it was the same, instead of fetching the corresponding values
  from the two different containers.
* Rework readOutputUntil() to avoid a bug where it might omit from the returned value the
  last buffer read when an error such as EOF occurs.
* Inline checkIfconfig(), since it's used in only one place and it could be reduced to a single line.
* Replace a number of uses of assert.NoError() with assert.NoErrorR().
* Change the existing TestSimpleVolume() function into a helper function which is called
  repeatedly by each of three new tests which use a table to generate the various scenarios.
  The three tests correspond to three host platform types -- non-Linux, SELinux, and Linux
  with SELinux disabled -- and the tests mark themselves as "skipped" if they don't match
  the host platform. Modify the test to create the bind-mounted file on the fly, so that sharing
  the same file between the containers doesn't lead to conflict; tighten up the pass/fail assertion.

---------

Signed-off-by: Thibault Guittet <88336850+rh-tguittet@users.noreply.github.com>
Co-authored-by: Thibault Guittet <88336850+rh-tguittet@users.noreply.github.com>
Co-authored-by: Thibault Guittet <tguittet@redhat.com>
  • Loading branch information
3 people authored Mar 29, 2024
1 parent daec7b5 commit a0b30ab
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 202 deletions.
Loading

0 comments on commit a0b30ab

Please sign in to comment.