~vila/ubuntu-test-cases/retry-apt-get-update

« back to all changes in this revision

Viewing changes to tests/default/pwd/test.sh

  • Committer: Leo Arias
  • Date: 2014-11-10 19:28:56 UTC
  • mfrom: (345 touch)
  • mto: This revision was merged to the branch mainline in revision 352.
  • Revision ID: leo.arias@canonical.com-20141110192856-rgpksx9n9j0b39yl
Merged with the touch branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
set -e
 
4
 
 
5
if [ -n "$TARGET_PREFIX" ] ; then
 
6
        echo "RUNNING FROM HOST"
 
7
else
 
8
        echo "RUNNING ON TARGET"
 
9
        TARGET_PREFIX="/bin/sh -c"
 
10
fi
 
11
 
 
12
#when it comes from adb we get a \r\n that should be removed
 
13
dir=$($TARGET_PREFIX "cd /tmp; pwd" | head -n1 | tr -d '\r\n')
 
14
if [ $dir != "/tmp" ] ; then
 
15
        echo "failed to change directory"
 
16
        exit 1
 
17
fi
 
18
exit 0