Skip to content

Commit

Permalink
debian: rename logrotate file to new package name
Browse files Browse the repository at this point in the history
LP: #2055046
  • Loading branch information
orndorffgrant committed Feb 26, 2024
1 parent 10b430f commit fcea342
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
ubuntu-advantage-tools (31.2) noble; urgency=medium

* properly rename logrotate conffile to avoid duplicate confiles, keep user changes
and avoid unnecessary prompts (LP: #2055046)

-- Grant Orndorff <grant.orndorff@canonical.com> Mon, 26 Feb 2024 11:47:55 -0500

ubuntu-advantage-tools (31.1) noble; urgency=medium

* fix unit test that failed on newer version of python
Expand Down
1 change: 1 addition & 0 deletions debian/ubuntu-advantage-tools.maintscript
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ rm_conffile /etc/cron.daily/ubuntu-advantage-tools 19.1~ ubuntu-advantage-tools
rm_conffile /etc/init/ua-auto-attach.conf 20.2~ ubuntu-advantage-tools
rm_conffile /etc/update-motd.d/88-esm-announce 27.14~ ubuntu-advantage-tools
rm_conffile /etc/ubuntu-advantage/help_data.yaml 30~ ubuntu-advantage-tools
mv_conffile /etc/logrotate.d/ubuntu-advantage-tools /etc/logrotate.d/ubuntu-pro-client 31.2~ ubuntu-advantage-tools
48 changes: 48 additions & 0 deletions features/logs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,51 @@ Feature: Logs in Json Array Formatter
| focal | lxd-container |
| jammy | lxd-container |
| mantic | lxd-container |

Scenario Outline: logrotate configuration works
Given a `<release>` `<machine_type>` machine with ubuntu-advantage-tools installed
When I run `pro status` with sudo
And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root
Then stdout contains substring:
"""
/var/log/ubuntu-advantage.log
"""
Then stdout does not contain substring:
"""
/var/log/ubuntu-advantage.log.1
"""
When I run `logrotate --force /etc/logrotate.d/ubuntu-pro-client` with sudo
And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root
Then stdout contains substring:
"""
/var/log/ubuntu-advantage.log
/var/log/ubuntu-advantage.log.1
"""
# reset and run logrotate with full config
When I run `rm /var/log/ubuntu-advantage.log.1` with sudo
When I run `pro status` with sudo
And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root
Then stdout contains substring:
"""
/var/log/ubuntu-advantage.log
"""
Then stdout does not contain substring:
"""
/var/log/ubuntu-advantage.log.1
"""
# This uses all logrotate config files on the system
When I run `logrotate --force /etc/logrotate.conf` with sudo
And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root
Then stdout contains substring:
"""
/var/log/ubuntu-advantage.log
/var/log/ubuntu-advantage.log.1
"""

Examples: ubuntu release
| release | machine_type |
| xenial | lxd-container |
| bionic | lxd-container |
| focal | lxd-container |
| jammy | lxd-container |
| mantic | lxd-container |
2 changes: 1 addition & 1 deletion uaclient/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from uaclient.exceptions import ProcessExecutionError
from uaclient.system import subp

__VERSION__ = "31.1"
__VERSION__ = "31.2"
PACKAGED_VERSION = "@@PACKAGED_VERSION@@"


Expand Down

0 comments on commit fcea342

Please sign in to comment.