Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions dnf-behave-tests/dnf/transaction-sr/store-option.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ Scenario: Store an install transaction
"nevra":"top-a-1:1.0-1.x86_64",
"action":"Install",
"reason":"User",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/top-a-1.0-1.x86_64.rpm"
},
{
"nevra":"mid-a1-1.0-1.x86_64",
"action":"Install",
"reason":"Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/mid-a1-1.0-1.x86_64.rpm"
},
{
"nevra":"bottom-a2-1.0-1.x86_64",
"action":"Install",
"reason":"Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/bottom-a2-1.0-1.x86_64.rpm"
},
{
"nevra":"mid-a2-1.0-1.x86_64",
"action":"Install",
"reason":"Weak Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/mid-a2-1.0-1.x86_64.rpm"
},
{
"nevra":"bottom-a3-1.0-1.x86_64",
"action":"Install",
"reason":"Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/bottom-a3-1.0-1.x86_64.rpm"
}
],
Expand Down Expand Up @@ -128,49 +128,49 @@ Scenario: Store a group install transaction
"nevra":"top-b-1.0-1.x86_64",
"action":"Install",
"reason":"Group",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/top-b-1.0-1.x86_64.rpm"
},
{
"nevra":"top-a-1:2.0-1.x86_64",
"action":"Install",
"reason":"Group",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/top-a-2.0-1.x86_64.rpm"
},
{
"nevra":"mid-a1-1.0-1.x86_64",
"action":"Install",
"reason":"Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/mid-a1-1.0-1.x86_64.rpm"
},
{
"nevra":"bottom-a1-2.0-1.noarch",
"action":"Install",
"reason":"Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/bottom-a1-2.0-1.noarch.rpm"
},
{
"nevra":"bottom-a2-1.0-1.x86_64",
"action":"Install",
"reason":"Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/bottom-a2-1.0-1.x86_64.rpm"
},
{
"nevra":"mid-a2-2.0-1.x86_64",
"action":"Install",
"reason":"Weak Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/mid-a2-2.0-1.x86_64.rpm"
},
{
"nevra":"bottom-a3-1.0-1.x86_64",
"action":"Install",
"reason":"Dependency",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_path":".\/packages\/bottom-a3-1.0-1.x86_64.rpm"
}
],
Expand All @@ -180,7 +180,7 @@ Scenario: Store a group install transaction
"action":"Install",
"reason":"User",
"group_path":".\/comps\/test-group.xml",
"repo_id":"transaction-sr",
"repo_id":"@stored_transaction(transaction-sr)",
"package_types":"mandatory, default, conditional"
}
],
Expand Down
102 changes: 102 additions & 0 deletions dnf-behave-tests/dnf/transaction-sr/store-replay.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
Feature: Store and replay transaction tests


Scenario: Replay a stored install transaction with relative path
Given I set working directory to "{context.dnf.tempdir}"
And I use repository "transaction-sr"
When I execute dnf with args "install top-a-1.0 --store ./install_trans"
Then the exit code is 0
And DNF Transaction is following
| Action | Package |
| install | top-a-1:1.0-1.x86_64 |
| install-dep | bottom-a2-0:1.0-1.x86_64 |
| install-dep | bottom-a3-0:1.0-1.x86_64 |
| install-dep | mid-a1-0:1.0-1.x86_64 |
| install-weak | mid-a2-0:1.0-1.x86_64 |
And RPMDB Transaction is empty
When I execute dnf with args "replay ./install_trans"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | top-a-1:1.0-1.x86_64 |
| install-dep | bottom-a2-0:1.0-1.x86_64 |
| install-dep | bottom-a3-0:1.0-1.x86_64 |
| install-dep | mid-a1-0:1.0-1.x86_64 |
| install-weak | mid-a2-0:1.0-1.x86_64 |
When I execute dnf with args "rq --installed --qf '%{{full_nevra}} %{{reason}} %{{from_repo}}\n'"
Then stdout is
"""
bottom-a2-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
bottom-a3-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
mid-a1-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
mid-a2-0:1.0-1.x86_64 Weak Dependency @stored_transaction(transaction-sr)
top-a-1:1.0-1.x86_64 User @stored_transaction(transaction-sr)
"""


Scenario: Replay a stored install transaction with absolute path
Given I use repository "transaction-sr"
When I execute dnf with args "install top-a-1.0 --store {context.dnf.tempdir}/install_trans"
Then the exit code is 0
And DNF Transaction is following
| Action | Package |
| install | top-a-1:1.0-1.x86_64 |
| install-dep | bottom-a2-0:1.0-1.x86_64 |
| install-dep | bottom-a3-0:1.0-1.x86_64 |
| install-dep | mid-a1-0:1.0-1.x86_64 |
| install-weak | mid-a2-0:1.0-1.x86_64 |
And RPMDB Transaction is empty
When I execute dnf with args "replay {context.dnf.tempdir}/install_trans"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | top-a-1:1.0-1.x86_64 |
| install-dep | bottom-a2-0:1.0-1.x86_64 |
| install-dep | bottom-a3-0:1.0-1.x86_64 |
| install-dep | mid-a1-0:1.0-1.x86_64 |
| install-weak | mid-a2-0:1.0-1.x86_64 |
When I execute dnf with args "rq --installed --qf '%{{full_nevra}} %{{reason}} %{{from_repo}}\n'"
Then stdout is
"""
bottom-a2-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
bottom-a3-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
mid-a1-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
mid-a2-0:1.0-1.x86_64 Weak Dependency @stored_transaction(transaction-sr)
top-a-1:1.0-1.x86_64 User @stored_transaction(transaction-sr)
"""


Scenario: Replay a stored install transaction with no repos configured
Given I set working directory to "{context.dnf.tempdir}"
And I use repository "transaction-sr"
When I execute dnf with args "install top-a-1.0 --store ./install_trans"
Then the exit code is 0
And DNF Transaction is following
| Action | Package |
| install | top-a-1:1.0-1.x86_64 |
| install-dep | bottom-a2-0:1.0-1.x86_64 |
| install-dep | bottom-a3-0:1.0-1.x86_64 |
| install-dep | mid-a1-0:1.0-1.x86_64 |
| install-weak | mid-a2-0:1.0-1.x86_64 |
And RPMDB Transaction is empty
Given I drop repository "transaction-sr"
When I execute dnf with args "replay ./install_trans"
Then the exit code is 0
And Transaction is following
| Action | Package |
| install | top-a-1:1.0-1.x86_64 |
| install-dep | bottom-a2-0:1.0-1.x86_64 |
| install-dep | bottom-a3-0:1.0-1.x86_64 |
| install-dep | mid-a1-0:1.0-1.x86_64 |
| install-weak | mid-a2-0:1.0-1.x86_64 |
When I execute dnf with args "rq --installed --qf '%{{full_nevra}} %{{reason}} %{{from_repo}}\n'"
Then stdout is
"""
bottom-a2-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
bottom-a3-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
mid-a1-0:1.0-1.x86_64 Dependency @stored_transaction(transaction-sr)
mid-a2-0:1.0-1.x86_64 Weak Dependency @stored_transaction(transaction-sr)
top-a-1:1.0-1.x86_64 User @stored_transaction(transaction-sr)
"""