Use chdist to avoid modifying the system apt cache
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
APT Stress Test Charm |
Fix Released
|
Undecided
|
Haw Loeung |
Bug Description
Hi,
In it's current form, it modifies the system apt cache with -o Dir::Etc:
| root@ip-
| N: Unable to locate package ubuntu-wallpapers
It is only after an 'apt-get update', without the Dir::Etc:
| root@ip-
| Get:1 http://
| ...
| Fetched 28.9 MB in 8s (3,224 kB/s)
| Reading package lists... Done
| root@ip-
| ubuntu-wallpapers - Ubuntu Wallpapers
| ubuntu-
This means security and package updates aren't applied.
I think we should change to using chdist. It shouldn't be that hard to rework to and would allow us to run as a non-root user. With this, we can also check for other series/distros.
~/.chdist structure:
| $ find -type f
| TEMPLATE/
| TEMPLATE/
| TEMPLATE/
| TEMPLATE/
TEMPLATE/
| deb [arch=amd64] TEMPLATE-REPLACE bionic main
| deb-src TEMPLATE-REPLACE bionic main
TEMPLATE.
| Apt {
| Architecture "amd64";
| };
|
| Dir "/home/
| Dir::State::status "/home/
Related branches
- Joel Sing (community): Approve (+1)
- Barry Price: Approve
-
Diff: 328 lines (+109/-65)4 files modifiedfiles/test_apt_mirrors.py (+48/-52)
layer.yaml (+1/-4)
reactive/apt_stresstest.py (+13/-9)
tests/test_test_apt_mirrors.py (+47/-0)
Changed in apt-stresstest-charm: | |
assignee: | nobody → Haw Loeung (hloeung) |
status: | New → In Progress |
Changed in apt-stresstest-charm: | |
status: | In Progress → Fix Committed |
status: | Fix Committed → Fix Released |
We also avoid these locking issues if apt is running (from outside stresstest):
| DEBUG: Sending data to influxdb: 127.0.0.1:8094 latex-extra- doc apt/lists/ lock - open (11: Resource temporarily unavailable) _duration_ seconds, test=uncached_ download_ 2_texlive- latex-extra- doc,mirror= sa-east- 1.ec2.archive. ubuntu. com,ip= 52.67.190. 94 value=0.065211
| E: Unable to locate package texlive-
| E: Could not get lock /var/lib/
| E: Unable to lock directory /var/lib/apt/lists/
apt_transaction