-
Notifications
You must be signed in to change notification settings - Fork 562
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
tests: show status of the partial test-snapd-huge snap in econnreset test #5333
Changes from 3 commits
2f17021
73b5f99
c8e7384
0c2cd7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,18 +9,25 @@ restore: | | |
# with the distro | ||
backends: [-autopkgtest] | ||
|
||
debug: | | ||
echo "Partial download status" | ||
ls -lh test-snapd-huge_* || true | ||
echo "other dir content" | ||
ls -lh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to dump /var/lib/snapd/cache here and reset it before the test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, maybe? But There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, never mind then. |
||
|
||
execute: | | ||
echo "Downloading a large snap in the background" | ||
rm -f test-snapd-huge_* | ||
su -c "/usr/bin/env SNAPD_DEBUG=1 snap download --edge test-snapd-huge 2>snap-download.log" test & | ||
su -c "/usr/bin/env SNAPD_DEBUG=1 SNAPD_DEBUG_HTTP=3 snap download --edge test-snapd-huge 2>snap-download.log" test & | ||
|
||
echo "Wait until the download started and downloaded more than 1 MB" | ||
for _ in $(seq 40); do | ||
echo "starting: $(date)" | ||
for _ in $(seq 400); do | ||
partial=$(find . -name 'test-snapd-huge_*.snap.partial' | head -1) | ||
if [ -n "$partial" ] && [ "$(stat -c%s "$partial")" -gt "$(( 1024 * 1024 ))" ]; then | ||
break | ||
fi | ||
sleep 1 | ||
sleep 0.1 | ||
done | ||
|
||
if [ ! -f "$partial" ] || [ "$(stat -c%s "$partial")" -eq 0 ]; then | ||
|
@@ -29,6 +36,13 @@ execute: | | |
exit 1 | ||
fi | ||
|
||
if [ "$(find . -name test-snapd-huge_*.snap )" -gt 1 ]; then | ||
echo "File fully downloaded before the test could act" | ||
echo "Test broken" | ||
echo "end: $(date)" | ||
exit 1 | ||
fi | ||
|
||
echo "Block the download using iptables" | ||
iptables -I OUTPUT -m owner --uid-owner "$(id -u test)" -j REJECT -p tcp --reject-with tcp-reset | ||
|
||
|
@@ -44,3 +58,5 @@ execute: | | |
# Note that the download will not be successful because of the nature of | ||
# the netfilter testbed. When snap download retries the next attempt will | ||
# end up with a "connection refused" error, something we do not retry | ||
debug: | | ||
cat snap-download.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and trying
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tryin' an' tryin' an' tryin'