puppet-network icon indicating copy to clipboard operation
puppet-network copied to clipboard

Add ability to set default restart value; add schedule and default schedule

Open esalberg opened this issue 8 years ago • 5 comments

add schedule and default schedule options to enable network restarts during change windows

esalberg avatar Oct 06 '17 16:10 esalberg

I did not add any spec tests so far, because 1) I wasn't sure how to test getting a class variable specifically (the restart functionality is already spec tested), and 2) I wasn't sure how to test schedules. Please let me know what sort of testing is needed (and point me in the right direction if possible).

esalberg avatar Oct 06 '17 16:10 esalberg

In case it's useful, this is the functional testing I completed:

Functional testing: DONE - restart false global (hiera global yaml)

  • updates file, does not refresh DONE - restart true global (hiera node yaml override)
  • updates file, refreshes DONE - schedule with global (restart true) -- does not update file DONE - schedule with global with override (restart true) -- updates file, refreshes DONE - schedule with global (restart false) -- updates file, does not refresh DONE - default restart true (unspecified in Hiera) -- updates file, refreshes DONE - default restart false (hiera global yaml) -- updates file, does not refresh DONE - default restart false with true override (hiera node yaml override; alias) -- updates file, refreshes DONE - default restart false with static interface change with schedule [assume without sched is the same] -- updates file, does not refresh DONE - default restart true with static interface change with schedule -- does not update file DONE - default restart true with static interface change without schedule -- updates file, refreshes DONE - default restart false with true override and schedule -- does not update file DONE - schedule with alias, schedule not on default interface -- updates default interface and not alias DONE - default schedule set in global.yaml -- does not update file DONE - default schedule set in global overridden in node file -- updates file, refreshes

esalberg avatar Oct 06 '17 17:10 esalberg

I know my tests are failing - I figured out how to run them locally and have fixed most of the issues. I'll update as soon as I'm done (lots of files).

esalberg avatar Oct 06 '17 22:10 esalberg

Rspec is updated. I also had to do a couple of rspec fixes for network_alias_spec.rb and network_if_static_spec.rb.

I also ran into a runtime error when trying to run spec tests against all the defines at once: RuntimeError: fact "hostname" already has the maximum number of resolutions allowed (100).

It looks like it's related to this ticket - but I wasn't sure when I might need to call Facter.clear - every spec test that uses facts? Just specific ones using facts in a certain way?

https://tickets.puppetlabs.com/browse/FACT-1016

esalberg avatar Oct 09 '17 17:10 esalberg

FYI - if you're at PuppetConf, let me know if you want to discuss the module there.

esalberg avatar Oct 10 '17 16:10 esalberg