summaryrefslogtreecommitdiff
path: root/test/tct_sdmux.bats
blob: d0cdcef76e532eb3f530c57f816972fa5e719f14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bats

. ./tct/flash/flash.sh

@test "is_connected" {
    RET=`sd-mux-ctrl -l | head -n 1 | grep -o "[0-9]*"`
    [ $RET -eq 1 ]
}

setup() {
    SDMUX=`sd-mux-ctrl -l | awk '/Serial/ {sub(",$", "", $6); print $6}'`
}

@test "sdmux_init" {
    sdmux_init "$SDMUX"
}

@test "switch2testserver" {
    switch2testserver "$SDMUX"
}

@test "switch2device" {
    switch2device "$SDMUX"
}

@test "restart_device" {
    restart_device "$SDMUX"
}

@test "change_id" {
    NEW_ID1="foo_bar"
    change_id "$SDMUX" "$NEW_ID1"
    NEW_ID2=`sd-mux-ctrl -l | awk '/Serial/ {sub(",$", "", $6); print $6}'`
    [ "${NEW_ID1}" = "${NEW_ID2}" ]
    change_id "$NEW_ID1" "$SDMUX"
}