diff options
author | Jiajun Xu <jiajun.xu@intel.com> | 2010-08-14 01:52:38 +0800 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-13 23:42:03 +0100 |
commit | 8c498e5338cfcbf97a4b6a0064e45ed2b755b25d (patch) | |
tree | bfbc53091e1c48455e4de69bac4166b55dee0945 /scripts | |
parent | 6fc5bdd1bb7a922e59602cb8ae7153a92b19d3d6 (diff) | |
download | poky-8c498e5338cfcbf97a4b6a0064e45ed2b755b25d.tar.gz |
testlib: Add support for qemumips/qemuppc/qemux86-64, and add support for testing with images from autobuilder
Signed-off-by Jiajun Xu <jiajun.xu@intel.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/qemuimage-testlib | 79 |
1 files changed, 72 insertions, 7 deletions
diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib index 4e27f8bc6f..6dc219da27 100644 --- a/scripts/qemuimage-testlib +++ b/scripts/qemuimage-testlib | |||
@@ -125,6 +125,71 @@ Test_Check_IP_UP() | |||
125 | fi | 125 | fi |
126 | } | 126 | } |
127 | 127 | ||
128 | # function to find kernel/rootfs image | ||
129 | Test_Find_Image() | ||
130 | { | ||
131 | where="" | ||
132 | kernel="" | ||
133 | arch="" | ||
134 | target="" | ||
135 | extension="" | ||
136 | rootfs="" | ||
137 | |||
138 | while getopts "l:k:a:t:" Option | ||
139 | do | ||
140 | case $Option in | ||
141 | l) where="$OPTARG" | ||
142 | ;; | ||
143 | k) kernel="$OPTARG" | ||
144 | extension="bin" | ||
145 | ;; | ||
146 | a) arch="$OPTARG" | ||
147 | ;; | ||
148 | t) target="$OPTARG" | ||
149 | extension="ext3" | ||
150 | ;; | ||
151 | *) echo "invalid option: -$Option" && return 1 | ||
152 | ;; | ||
153 | esac | ||
154 | done | ||
155 | |||
156 | if [ ! -z $kernel ]; then | ||
157 | if [ -L ${where}/${kernel}-${arch}.${extension} ]; then | ||
158 | echo ${where}/${kernel}-${arch}.${extension} | ||
159 | return 0 | ||
160 | else | ||
161 | for i in `dir ${where}` | ||
162 | do | ||
163 | echo $i | grep -q "${kernel}.*${arch}.*\.${extension}" | ||
164 | if [ $? -eq 0 ]; then | ||
165 | echo ${where}/${i} | ||
166 | return 0 | ||
167 | fi | ||
168 | done | ||
169 | return 1 | ||
170 | fi | ||
171 | fi | ||
172 | |||
173 | if [ ! -z $target ]; then | ||
174 | if [ -L ${where}/${target}-${arch}.${extension} ]; then | ||
175 | rootfs=`readlink -f ${where}/${target}-${arch}.${extension}` | ||
176 | echo ${rootfs} | ||
177 | return 0 | ||
178 | else | ||
179 | for i in `dir ${where}` | ||
180 | do | ||
181 | echo $i | grep -q "${target}-${arch}.*\.${extension}" | ||
182 | if [ $? -eq 0 ]; then | ||
183 | echo ${where}/${i} | ||
184 | return 0 | ||
185 | fi | ||
186 | done | ||
187 | return 1 | ||
188 | fi | ||
189 | fi | ||
190 | return 1 | ||
191 | } | ||
192 | |||
128 | # function to check if qemu and its network | 193 | # function to check if qemu and its network |
129 | Test_Create_Qemu() | 194 | Test_Create_Qemu() |
130 | { | 195 | { |
@@ -132,8 +197,6 @@ Test_Create_Qemu() | |||
132 | local up_time=0 | 197 | local up_time=0 |
133 | local ip_addr=$1 | 198 | local ip_addr=$1 |
134 | local timeout=$2 | 199 | local timeout=$2 |
135 | local kernel="" | ||
136 | local rootfs="" | ||
137 | 200 | ||
138 | which poky-qemu | 201 | which poky-qemu |
139 | if [ $? -eq 0 ]; then | 202 | if [ $? -eq 0 ]; then |
@@ -143,13 +206,15 @@ Test_Create_Qemu() | |||
143 | exit 1 | 206 | exit 1 |
144 | fi | 207 | fi |
145 | 208 | ||
146 | if [ "$QEMUARCH" = "qemux86" ]; then | 209 | if [ "$QEMUARCH" = "qemux86" -o "$QEMUARCH" = "qemux86-64" ]; then |
147 | KERNEL=${DEPLOY_DIR}/images/bzImage-${QEMUARCH}.bin | 210 | KERNEL=$(Test_Find_Image -l ${DEPLOY_DIR}/images -k bzImage -a ${QEMUARCH}) |
148 | elif [ "$QEMUARCH" = "qemuarm" -o "$QEMUARCH" = "spitz" -o "$QEMUARCH" = "borzoi" -o "$QEMUARCH" = "akita" -o "$QEMUARCH" = "nokia800" ]; then | 211 | elif [ "$QEMUARCH" = "qemuarm" -o "$QEMUARCH" = "spitz" -o "$QEMUARCH" = "borzoi" -o "$QEMUARCH" = "akita" -o "$QEMUARCH" = "nokia800" -o "$QEMUARCH" = "qemuppc" ]; then |
149 | KERNEL=${DEPLOY_DIR}/images/zImage-${QEMUARCH}.bin | 212 | KERNEL=$(Test_Find_Image -l ${DEPLOY_DIR}/images -k zImage -a ${QEMUARCH}) |
213 | elif [ "$QEMUARCH" = "qemumips" ]; then | ||
214 | KERNEL=$(Test_Find_Image -l ${DEPLOY_DIR}/images -k vmlinux -a ${QEMUARCH}) | ||
150 | fi | 215 | fi |
151 | 216 | ||
152 | ROOTFS_IMAGE=`readlink -f ${DEPLOY_DIR}/images/${QEMUTARGET}-${QEMUARCH}.ext3` | 217 | ROOTFS_IMAGE=$(Test_Find_Image -l ${DEPLOY_DIR}/images -t ${QEMUTARGET} -a ${QEMUARCH}) |
153 | TEST_ROOTFS_IMAGE="${TEST_TMP}/${QEMUTARGET}-${QEMUARCH}-test.ext3" | 218 | TEST_ROOTFS_IMAGE="${TEST_TMP}/${QEMUTARGET}-${QEMUARCH}-test.ext3" |
154 | 219 | ||
155 | CP=`which cp` | 220 | CP=`which cp` |