~jocave/checkbox/hybrid-amd-gpu-mods

« back to all changes in this revision

Viewing changes to checkbox-old/scripts/bluetooth_test

  • Committer: Zygmunt Krynicki
  • Date: 2013-05-29 07:50:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2153.
  • Revision ID: zygmunt.krynicki@canonical.com-20130529075030-ngwz245hs2u3y6us
checkbox: move current checkbox code into checkbox-old

This patch cleans up the top-level directory of the project into dedicated
sub-project directories. One for checkbox-old (the current checkbox and all the
associated stuff), one for plainbox and another for checkbox-ng.

There are some associated changes, such as updating the 'source' mode of
checkbox provider in plainbox, and fixing paths in various test scripts that we
have.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
set -e
 
3
 
 
4
TEST_FILENAME=`basename $1`
 
5
TEST_FILE=$1
 
6
BTADDR=$2
 
7
ACTION=$3
 
8
 
 
9
if ! dpkg-query -W obexftp >/dev/null 2>&1; then
 
10
    echo "You must install obexftp to run this script"
 
11
    exit 1
 
12
fi
 
13
 
 
14
if [ $# -ne 3 ]; then
 
15
    echo "Usage: bt_send.sh <file to send> <bluetooth mac address> <send|browse|get|remove>"
 
16
    exit 1
 
17
fi
 
18
 
 
19
if [ $ACTION == "send" ]; then
 
20
    echo "Using" $TEST_FILENAME "as a test file"
 
21
    echo "Sending" $TEST_FILE "to" $BTADDR
 
22
    obexput -b $BTADDR $TEST_FILE 2>&1 | grep "Sending\(.*\)done"
 
23
    sleep 1
 
24
    echo "PASS"
 
25
elif [ $ACTION == "browse" ]; then
 
26
    FILE_SIZE=`ls -al $TEST_FILE|awk '{print $5}'`
 
27
    echo "Checking" $BTADDR "for" $TEST_FILENAME
 
28
    echo "Will check for a filesize of " $FILE_SIZE
 
29
    sleep 1
 
30
    obexftp -b $BTADDR -l | grep $TEST_FILENAME | grep 'size="'$FILE_SIZE'"'
 
31
    sleep 1
 
32
    echo "PASS"
 
33
elif [ $ACTION == "remove" ]; then
 
34
    echo "Removing" $TEST_FILENAME "from" $BTADDR
 
35
    sleep 1
 
36
    obexrm -b $BTADDR $TEST_FILENAME 2>&1 | grep "Disconnecting"
 
37
    echo "PASS"
 
38
elif [ $ACTION == "get" ]; then
 
39
    cd /tmp
 
40
    echo "Checking for file size of" $TEST_FILENAME
 
41
    RECV_FILE_SIZE=`obexftp -b $BTADDR -l | grep $TEST_FILENAME | awk '{print $3}'| tr -cd [:digit:]`
 
42
    sleep 4
 
43
    echo "Getting file" $TEST_FILENAME "from" $BTADDR "with a size of" $RECV_FILE_SIZE
 
44
    obexget -b $BTADDR $TEST_FILENAME 2>&1 | grep "Receiving\(.*\)done"
 
45
    ls -l |grep $TEST_FILENAME | grep $RECV_FILE_SIZE
 
46
    echo "PASS"
 
47
fi