Skip to content

Commit

Permalink
Merge pull request #3327 from chipaca/tweak-listing-core-regexp
Browse files Browse the repository at this point in the history
tests: fix failing tests (snap core version, syslog changes)
  • Loading branch information
chipaca authored May 16, 2017
2 parents 295dfb6 + d7725a7 commit e2ae1e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/lib/snaps/log-observe-consumer/bin/consumer
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import sys

def run():
try:
subprocess.check_output("tail -n 10 /var/log/syslog", shell=True)
subprocess.check_output("journalctl -n 10", shell=True)
print("ok")
except Exception as e:
print("error accessing log")
Expand Down
7 changes: 5 additions & 2 deletions tests/main/listing/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ prepare: |
execute: |
echo "List prints core snap version"
# most core versions should be like "16-2", so [0-9]{2}-[0-9.]+
# but edge will have a timestamp in there, "16.2+201701010932", so add an optional \+[0-9]+ to the end
# *current* edge also has .git. and a hash snippet, so add an optional .git.[0-9a-f]+ to the already optional timestamp
if [ "$SPREAD_BACKEND" = "linode" -o "$SPREAD_BACKEND" == "qemu" ] && [ "$SPREAD_SYSTEM" = "ubuntu-core-16-64" ]; then
echo "With customized images the ubuntu-core snap is sideloaded"
expected="^core .* [0-9]{2}-[0-9.]+ +x[0-9]+ +- *$"
expected='^core .* [0-9]{2}-[0-9.]+(\+[0-9]+(\.git\.[0-9a-f]+)?)? +x[0-9]+ +- *$'
else
expected="^core .* [0-9]{2}-[0-9.]+ +[0-9]+ +canonical +- *$"
expected='^core .* [0-9]{2}-[0-9.]+(\+[0-9]+(\.git\.[0-9a-f]+)?)? +[0-9]+ +canonical +- *$'
fi
snap list | MATCH "$expected"
Expand Down

0 comments on commit e2ae1e4

Please sign in to comment.