Skip to content

Commit

Permalink
New tests for adjust duration (#3281)
Browse files Browse the repository at this point in the history
Adding 3 new tests for adjust duration:
+ Combining multiple duration strings
+ Multiplying by a value
+ Adding a value

Signed-off-by: Luigi Pellecchia <lpellecc@redhat.com>
Co-authored-by: Luigi Pellecchia <lpellecc@redhat.com>
  • Loading branch information
pellecchialuigi and Luigi Pellecchia authored Oct 17, 2024
1 parent 91f838b commit 45cde3b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/core/adjust/data/tests.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
duration: 1m
when: arch == ppc64

/adjust-duration-combine:
test: echo 'adjust duration combine'
duration: 1s
adjust:
- duration+: 1h1m

/adjust-duration-multi:
test: echo 'adjust duration multi'
duration: 1m
adjust:
- duration+: '*2.5'

/adjust-duration-sum:
test: echo 'adjust duration sum'
duration: 1s
adjust:
- duration+: '+10s'

/pidof:
test: pidof sh
adjust:
Expand Down
9 changes: 9 additions & 0 deletions tests/core/adjust/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ rlJournalStart
rlAssertGrep 'enabled\s+false' $output -E
rlRun "tmt -c @context.yaml test show uptime | tee $output"
rlAssertGrep 'duration\s+1m' $output -E
# uptime duration adjusted with combination
rlRun "tmt test show adjust-duration-combine | tee $output"
rlAssertGrep 'duration\s+1s1h1m' $output -E
# uptime duration adjusted with multiplication
rlRun "tmt test show adjust-duration-multi | tee $output"
rlAssertGrep 'duration\s+1m\*2\.5' $output -E
# uptime duration adjusted with sum
rlRun "tmt test show adjust-duration-sum | tee $output"
rlAssertGrep 'duration\s+1s\+10s' $output -E
rlPhaseEnd

rlPhaseStartTest "Show plans"
Expand Down

0 comments on commit 45cde3b

Please sign in to comment.