Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
tests: add whoami check #3459
Merged
Commits
Jump to file or symbol
Failed to load files and symbols.
| @@ -0,0 +1,13 @@ | ||
| +log_user 0 | ||
| +spawn snap login $env(SPREAD_STORE_USER) | ||
| + | ||
| +expect "Password of " | ||
| +send "$env(SPREAD_STORE_PASSWORD)\n" | ||
| + | ||
| +expect { | ||
| + "Login successful" { | ||
| + exit 0 | ||
| + } default { | ||
| + exit 1 | ||
| + } | ||
| +} |
| @@ -0,0 +1,18 @@ | ||
| +summary: Checks for snap whoami | ||
| + | ||
| +# ppc64el disabled because of https://bugs.launchpad.net/snappy/+bug/1655594 | ||
| +systems: [-ubuntu-core-16-*, -ubuntu-*-ppc64el] | ||
| + | ||
| +restore: | | ||
| + snap logout || true | ||
| + | ||
| +execute: | | ||
| + echo "whoami before login" | ||
| + snap whoami | MATCH "email: -" | ||
| + | ||
| + if [ -n "$SPREAD_STORE_USER" ] && [ -n "$SPREAD_STORE_PASSWORD" ]; then | ||
| + expect -d -f successful_login.exp | ||
| + | ||
| + echo "whoami after login" | ||
| + snap whoami | MATCH "email: $SPREAD_STORE_USER" | ||
| + fi |