Skip to content

Fix to make software update checks spec more reliable

Georgi N. Georgiev requested to merge fix-softwareupdate-spec-new-software into master

Based on !99 (merged)

What does this MR do?

When softwareupdate -l finishes it appears that sometimes it doesn't properly write to it's stdout when there are no software updates.

This fix gets the list of updates and writes them to a file, we then grep by recommended, presumable all updates will container Recommended: YES/NO:

Finding available software
Software Update found the following new or updated software:
* Label: ProVideoFormats-2.2.1
	Title: Pro Video Formats, Version: 2.2.1, Size: 8175K, Recommended: YES,
* Label: Safari14.1.1CatalinaAuto-14.1.1
	Title: Safari, Version: 14.1.1, Size: 91353K, Recommended: YES,
* Label: macOS Catalina Security Update 2021-003-10.15.7
	Title: macOS Catalina Security Update 2021-003, Version: 10.15.7, Size: 1843643K, Recommended: YES, Action: restart,

I am not 100% sure that this will be reliable but it seems like it should be. From my tests so far it has been working.

Why was this MR needed?

What's the best way to test this MR?

Follow the instructions to setup the rspec environment

http://gitlab.com/gitlab-org/ci-cd/shared-runners/images/macstadium/orka/blob/cdb77ce4571a7c9431e5cdc06739e708fcd69563/README.md#L90-L90

Run the following command:

bundle exec rspec spec/os_prepare/main_spec.rb

roles/os_prepare/softwareupdate should pass

What are the relevant issue numbers?

Closes #82 (closed)

Edited by Georgi N. Georgiev

Merge request reports