Skip to content

Commit

Permalink
Transaction merging test
Browse files Browse the repository at this point in the history
Test whether transactions are merged properly in
history info output.
  • Loading branch information
edcuba authored and Eduard Čuba committed Oct 9, 2017
1 parent 48ee082 commit 9003100
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
19 changes: 14 additions & 5 deletions dnf-docker-test/features/history-2.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Feature: DNF/Behave test Transaction history [info, list, userinstalled]
| Return-Code | Success |
| Erase | TestA, TestB |

Scenario: History info in range
Scenario: History info in range - transaction merging
When I save rpmdb
And I successfully run "dnf install -y TestA"
Then history info should match
Expand All @@ -71,13 +71,22 @@ Feature: DNF/Behave test Transaction history [info, list, userinstalled]
| Return-Code | Success |
| Upgrade | TestA, TestB |
| Upgraded | TestA, TestB |

And history info "last-1..last" should match
| Key | Value |
| Return-Code | Success |
| Install | TestA |
And history info "last-2..last" should match
| Key | Value |
| Return-Code | Success |
| Upgrade | TestA, TestB |
| Upgraded | TestA, TestB |
| Install | TestA, TestB |
| Erase | TestA, TestB |
| Upgrade | TestA |
| Upgraded | TestA |
And history info "last-2..last-1" should match
| Key | Value |
| Return-Code | Success |
| Reinstall | TestA |

Scenario: History info of package
And history info "TestA" should match
| Key | Value |
| Return-Code | Success |
Expand Down
5 changes: 2 additions & 3 deletions dnf-docker-test/features/steps/command_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def step_history_contains(ctx, cmd, act, alt, range=""):
step_i_run_command(ctx, 'dnf history ' + range)
text = getattr(ctx.cmd_result, 'stdout')
lines = text.split('\n')
assert len(lines) > 3, 'No output'
del lines[:3]
assert len(lines) > 2, 'No output'
del lines[:2]
match = False
for line in lines:
columns = line.split('|')
Expand Down Expand Up @@ -224,7 +224,6 @@ def pkgs_split(pkgs):

if brpmdb and erpmdb:
assert len(brpmdb) == len(erpmdb) == 3, 'Unexpected rpmdb version format'
assert brpmdb[2] != erpmdb[2], 'No change in rpmdb version'
erpmdb = None

if 'Return-Code' in line and g_retcode:
Expand Down

0 comments on commit 9003100

Please sign in to comment.