~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/lxc/lxd/test/suites/concurrent.sh

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
test_concurrent() {
 
4
  ensure_import_testimage
 
5
 
 
6
  spawn_container() {
 
7
    set -e
 
8
 
 
9
    name=concurrent-${1}
 
10
 
 
11
    lxc launch testimage "${name}"
 
12
    lxc info "${name}" | grep Running
 
13
    echo abc | lxc exec "${name}" -- cat | grep abc
 
14
    lxc stop "${name}" --force
 
15
    lxc delete "${name}"
 
16
  }
 
17
 
 
18
  PIDS=""
 
19
 
 
20
  for id in $(seq $(($(find /sys/bus/cpu/devices/ -type l | wc -l)*8))); do
 
21
    spawn_container "${id}" 2>&1 | tee "${LXD_DIR}/lxc-${id}.out" &
 
22
    PIDS="${PIDS} $!"
 
23
  done
 
24
 
 
25
  for pid in ${PIDS}; do
 
26
    wait "${pid}"
 
27
  done
 
28
 
 
29
  ! lxc list | grep -q concurrent
 
30
}