Commit Graph

2 Commits

Author SHA1 Message Date
Claudiu Belu
d3237b7258 unittests: Fixes unit tests for Windows (part 7)
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- if a powershell command that could return an array (e.g.: Get-Disk) would return an array of
  only one element, powershell will in fact return that object directly, and **not** an array
  containing that element. In a few cases, these commands are used and their output is converted
  to json, after which they're unmarshalled in golang, with the expectation that the unmarshalled
  data to be an array. If it's not an array, we get an error.
- when mounting Block Devices, Windows expects the given source to be a Disk Number, not a path.
- for rbd_windows_test.go, we should start with Disk Number 0, which exists on all hosts.
- if a Disk has multiple volumes, Get-Volume doesn't return the volumes in the same order. This
  can result in various assertions failing.
- the pkg/volume/rbd/rdb_test.TestPlugin test expects that mounter.MountSensitive is called when
  attacher.MountDevice is called. The Windows attacher doesn't currently make that call.
2023-05-08 10:53:39 +00:00
Claudiu Belu
4dc7a260ec unittests: Fixes unit tests for Windows (part 4)
Currently, there are some unit tests that are failing on Windows due to
various reasons:

- paths not properly joined (filepath.Join should be used).
- files not closed, which means that they cannot be removed / renamed.
- time.Now() is not as precise on Windows, which means that 2
  consecutive calls may return the same timestamp.
2022-11-29 16:32:26 +00:00