Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic: Test command_format variable expansion #1615

Merged
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
30 changes: 27 additions & 3 deletions dnf-behave-tests/dnf/dnf-automatic/error-report.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,38 @@ Scenario: emitters report errors by default
emit_via = command_email

[command_email]
command_format = "echo {{body}} > {context.dnf.tempdir}/dnf_error"
command_format = "echo {{body}} > {context.dnf.tempdir}/dnf_command_email_error"
"""
And I successfully execute dnf with args "install test-1.0"
And file "/{context.dnf.tempdir}/dnf_error" does not exist
And file "/{context.dnf.tempdir}/dnf_command_email_error" does not exist
When I execute dnf with args "automatic --installupdates"
Then the exit code is 1
And RPMDB Transaction is empty
And file "/{context.dnf.tempdir}/dnf_error" contains lines
And file "/{context.dnf.tempdir}/dnf_command_email_error" contains lines
"""
Transaction failed: Rpm transaction failed.
"""

@gdb
Scenario: {body} substituted in command_format for command emitter
Given I create and substitute file "/etc/dnf/automatic.conf" with
"""
[commands]
download_updates = yes
apply_updates = yes

[emitters]
emit_via = command

[command]
command_format = "echo {{body}} > {context.dnf.tempdir}/dnf_command_error"
"""
And I successfully execute dnf with args "install test-1.0"
And file "/{context.dnf.tempdir}/dnf_command_error" does not exist
When I execute dnf with args "automatic --installupdates"
Then the exit code is 1
And RPMDB Transaction is empty
And file "/{context.dnf.tempdir}/dnf_command_error" contains lines
"""
Transaction failed: Rpm transaction failed.
"""
Loading