~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/lxc/lxd/test/suites/exec.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_exec() {
 
4
  ensure_import_testimage
 
5
 
 
6
  name=x1
 
7
  lxc launch testimage x1
 
8
  lxc list ${name} | grep RUNNING
 
9
 
 
10
  exec_container() {
 
11
    echo "abc${1}" | lxc exec "${name}" -- cat | grep abc
 
12
  }
 
13
 
 
14
  PIDS=""
 
15
  for i in $(seq 1 50); do
 
16
    exec_container "${i}" > "${LXD_DIR}/exec-${i}.out" 2>&1 &
 
17
    PIDS="${PIDS} $!"
 
18
  done
 
19
 
 
20
  for pid in ${PIDS}; do
 
21
    wait "${pid}"
 
22
  done
 
23
 
 
24
  lxc stop "${name}" --force
 
25
  lxc delete "${name}"
 
26
}