~maxiberta/ols-jenkaas/build-snapstats-realtime-charm

« back to all changes in this revision

Viewing changes to slave/lxc-test

  • Committer: Daniel Manrique
  • Date: 2018-11-16 20:40:28 UTC
  • Revision ID: roadmr@ubuntu.com-20181116204028-6tbov8sg0c2nm1g8
LXC diagnostic fixes.

- Wait for an IP
- Print lxc info
- DOn't generate container names that start with numbers, as those are invalid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
ls -la
4
4
ls -la /
5
5
whoami
6
 
container_name=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')
 
6
container_name=$(head /dev/urandom | tr -dc A-Za-z| head -c 8 ; echo '')
7
7
lxc init ubuntu:16.04 $container_name
8
8
lxc start $container_name
 
9
# Ostensibly to wait for an IP
 
10
lxc exec $container_name -- sleep 10
9
11
lxc exec $container_name -- uname -a
10
12
lxc exec $container_name -- pwd
11
13
lxc exec $container_name -- ls -la
14
16
set +e
15
17
lxc exec $container_name -- python -c "import os; print os.path.relpath(os.getcwd(), os.path.realpath(os.path.expanduser('~/workspace')))"
16
18
set -e
 
19
lxc info $container_name
17
20
lxc stop --timeout=60 $container_name
18
21
lxc delete $container_name