Issue #7639 has been updated by Jeff Weiss.

Status changed from In Topic Branch Pending Review to Tests Insufficient
Assignee set to Sean Millichamp

The code change in the pull request is great; however, I'd like to see some 
tests that explicitly exercise the bounds of the range to demonstrate if the 
range bounds are inclusive or exclusive.

Sean, do you mind taking a crack at these tests?
----------------------------------------
Bug #7639: Schedule resource accepts invalid schedules
https://projects.puppetlabs.com/issues/7639#change-60478

Author: Josh Cooper
Status: Tests Insufficient
Priority: Normal
Assignee: Sean Millichamp
Category: 
Target version: 
Affected Puppet version: 
Keywords: schedule
Branch: https://github.com/puppetlabs/puppet/pull/655


There are some problems with the schedule resource in how it parses and applies 
ranges:

* Resources may span days, even though the code attempts to prevent this.

  The code ensures that the lower limit hour is less than the upper limit hour, 
but does not check the minutes and seconds. As a result, a schedule of the form:
  <pre>
 schedule {
   maint: range => "1:2:3 - 1:0:0"
 }
  </pre>
  will result in an upper limit of 1AM tomorrow. In other words, we are 
spanning days, even though the code tries to prevent it.

* If minutes or seconds are omitted, they default to Time.now's minutes and 
seconds. 

  If you specify a schedule range of the form: "1:59:59 - 1" and Time.now's 
minutes and/or seconds are less, the same behavior as above can result.  As an 
aside it seems more intuitive that we default minutes and seconds to 0, even 
though it wouldn't prevent this scenario.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to