From: Shuangquan Zhou Date: Tue, 23 Aug 2011 03:06:38 +0000 (+0800) Subject: Added a testcase about ARM X-Git-Tag: 0.1~181 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=760603a525e3cd8be22eee9cff37e29c6b5a769d;p=platform%2Fupstream%2Fmic.git Added a testcase about ARM Signed-off-by: Shuangquan Zhou --- diff --git a/tests/addcase.sh b/tests/addcase.sh index 2ea1f22..7fbaaab 100755 --- a/tests/addcase.sh +++ b/tests/addcase.sh @@ -1,7 +1,7 @@ #!/bin/sh if [ $# -ne 2 ]; then - echo "Usage addcase.sh " + echo "Usage: addcase.sh " exit 1 fi @@ -10,13 +10,22 @@ CaseKs=$2 diff -upN ./mic_cases/base/test.ks ${CaseKs} > ks.p +cp ./mic_cases/base/test.conf conf_new +vi conf_new +diff -upN ./mic_cases/base/test.conf conf_new > conf.p +rm -f conf_new + cd ./mic_cases mkdir test-${CaseName} cd test-${CaseName} mv ../../ks.p . +mv ../../conf.p . vi options vi expect echo 'Ks diff:' cat ks.p + +echo 'Config diff:' +cat conf.p diff --git a/tests/mic_cases/base/test.conf b/tests/mic_cases/base/test.conf new file mode 100644 index 0000000..11f0d0f --- /dev/null +++ b/tests/mic_cases/base/test.conf @@ -0,0 +1,20 @@ +[common] +; general settings + +[create] +; settings for create subcommand +tmpdir= /var/tmp +cachedir= /var/tmp/cache +outdir= . +pkgmgr = zypp +arch = i586 + +; proxy = http://proxy.yourcompany.com:8080/ +; no_proxy = localhost,127.0.0.0/8,.yourcompany.com + +[convert] +; settings for convert subcommand + +[chroot] +; settings for chroot subcommand + diff --git a/tests/mic_cases/test-armck/conf.p b/tests/mic_cases/test-armck/conf.p new file mode 100644 index 0000000..8cc0d39 --- /dev/null +++ b/tests/mic_cases/test-armck/conf.p @@ -0,0 +1,11 @@ +--- ./mic_cases/base/test.conf 2011-08-23 10:55:02.062109222 +0800 ++++ conf_new 2011-08-23 11:01:52.204093784 +0800 +@@ -7,7 +7,7 @@ tmpdir= /var/tmp + cachedir= /var/tmp/cache + outdir= . + pkgmgr = zypp +-arch = i586 ++arch = armv7l + + ; proxy = http://proxy.yourcompany.com:8080/ + ; no_proxy = localhost,127.0.0.0/8,.yourcompany.com diff --git a/tests/mic_cases/test-armck/ks.p b/tests/mic_cases/test-armck/ks.p new file mode 100644 index 0000000..1ff7f7f --- /dev/null +++ b/tests/mic_cases/test-armck/ks.p @@ -0,0 +1,133 @@ +--- ./mic_cases/base/test.ks 2011-08-23 09:44:14.192145003 +0800 ++++ meego-handset-armv7l-n900-1.1.ks 2011-08-23 10:31:43.047093908 +0800 +@@ -1,60 +1,93 @@ +-# +-# Do not Edit! Generated by: +-# kickstarter.py +-# +- + lang en_US.UTF-8 + keyboard us + timezone --utc America/Los_Angeles +-part / --size 3000 --ondisk sda --fstype=ext3 +-rootpw meego ++#auth --useshadow --enablemd5 ++#part / --size=1600 --ondisk mmcblk0p --fstype=btrfs ++part / --size=1750 --ondisk mmcblk0p --fstype=ext3 ++ ++# Add swap partition. It is a bit bad practise to have the swap on the same ++# device as root partition, but currently we do not want to do changes to the ++# N900 internal memories (emmc or nand). ++part swap --size=256 --ondisk mmcblk0p --fstype=swap ++ ++rootpw meego + xconfig --startxonboot +-bootloader --timeout=0 --append="quiet" +-desktop --autologinuser=meego +-user --name meego --groups audio,video --password meego ++desktop --autologinuser=meego --defaultdesktop=DUI --session=/usr/bin/mcompositor ++user --name meego --groups audio,video --password meego + +-repo --name=1.2-oss --baseurl=http://download.meego.com/snapshots/1.2.0.90.12.20110808.80/repos/oss/ia32/packages/ --save --debuginfo --source --gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-meego +-repo --name=1.2-non-oss --baseurl=http://download.meego.com/snapshots/1.2.0.90.12.20110808.80/repos/non-oss/ia32/packages/ --save --debuginfo --source --gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-meego ++repo --name=core --baseurl=http://linux-ftp.intel.com/pub/mirrors/MeeGo/releases/1.1/core/repos/armv7l/packages/ --save --debuginfo --source --gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-meego01 ++repo --name=handset --baseurl=http://linux-ftp.intel.com/pub/mirrors/MeeGo/releases/1.1/handset/repos/armv7l/packages/ --save --debuginfo --source --gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-meego01 ++repo --name=non-oss --baseurl=http://linux-ftp.intel.com/pub/mirrors/MeeGo/releases/1.1/non-oss/repos/armv7l/packages/ --save --debuginfo --source --gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-meego01 + + %packages +- +-@MeeGo Base Development +-@Base Double Byte IME Support +-@MeeGo Compliance + @MeeGo Core +-@MeeGo X Window System +-@X for Netbooks +-@MeeGo Netbook +-@MeeGo Netbook Desktop +-@Printing +-@Games +- +-kernel-adaptation-pinetrail +- +-chromium +--adobe-release +--flash-plugin ++@MeeGo Base ++@Minimal MeeGo X Window System ++@MeeGo Compliance ++@Nokia N900 Support ++@MeeGo Handset Desktop ++@MeeGo Handset Applications ++@MeeGo Handset Applications Branding ++@Nokia N900 Proprietary Support ++@X for Handsets ++@MeeGo Handset Base Support ++ ++# Some development tools ++openssh-server ++wget ++strace ++bootchart ++gdb ++gdb-gdbserver ++ ++# Some extra tools/libs ++connman-test ++xorg-x11-utils-xev ++ ++# http://bugs.meego.com/show_bug.cgi?id=5651 ++-meegotouch-inputmethodbridges ++-meegotouch-inputmethodframework ++-meegotouch-inputmethodkeyboard ++-meegotouch-inputmethodengine + %end + + %post +-# save a little bit of space at least... +-rm -f /boot/initrd* ++# Prelink not included because of following bug ++# http://bugs.meego.com/show_bug.cgi?id=5217 + +-# Prelink can reduce boot time +-if [ -x /usr/sbin/prelink ]; then +- /usr/sbin/prelink -aRqm +-fi ++# make sure there aren't core files lying around ++rm -f /core* ++ ++# open serial line console for embedded system ++echo "s0:235:respawn:/sbin/agetty -L 115200 ttyS2 vt100" >> /etc/inittab + ++# work around for poor key import UI in PackageKit + rm -f /var/lib/rpm/__db* + rpm --rebuilddb + +- ++# Set up sane defaults for mthemedaemon settings ++Config_Src=`gconftool-2 --get-default-source` ++gconftool-2 --direct --config-source $Config_Src \ ++ -s -t string /meegotouch/theme/target N900 ++ ++# By default N900 has different value than Aava for showStatusBar ++sed -i 's!showStatusBar=false!showStatusBar=true!g' /etc/meegotouch/devices.conf ++ ++# Normal bootchart is only 30 long so we use this to get longer bootchart during startup when needed. ++cat > /sbin/bootchartd-long << EOF ++#!/bin/sh ++exec /sbin/bootchartd -n 4000 ++EOF ++chmod +x /sbin/bootchartd-long ++ ++# Temporary fix for BMC#8664 to get fennec startup time more reasonable. ++mkdir -p /home/meego/.mozilla/ ++chown -R meego:meego /home/meego/.mozilla/ ++echo "tmpfs /home/meego/.mozilla tmpfs size=20m 0 0" >> /etc/fstab + %end + + %post --nochroot + if [ -n "$IMG_NAME" ]; then + echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release + fi +- +- + %end diff --git a/tests/mic_cases/test-armck/options b/tests/mic_cases/test-armck/options new file mode 100644 index 0000000..17fa685 --- /dev/null +++ b/tests/mic_cases/test-armck/options @@ -0,0 +1 @@ +mic cr raw diff --git a/tests/mic_cases/test-genimg/conf.p b/tests/mic_cases/test-genimg/conf.p new file mode 100644 index 0000000..e69de29 diff --git a/tests/mic_cases/test-ksck/conf.p b/tests/mic_cases/test-ksck/conf.p new file mode 100644 index 0000000..e69de29 diff --git a/tests/mic_cases/test-rootck/conf.p b/tests/mic_cases/test-rootck/conf.p new file mode 100644 index 0000000..e69de29 diff --git a/tests/testbase.py b/tests/testbase.py index f9f8568..b5cbe87 100644 --- a/tests/testbase.py +++ b/tests/testbase.py @@ -7,6 +7,16 @@ _ = gettext.lgettext COLOR_BLACK = "\033[00m" COLOR_RED = "\033[1;31m" +PRESCRIPTS = """ +patch -s < ks.p +patch -s < conf.p +sudo mv /etc/mic/mic.conf /etc/mic/orig.conf +sudo mv test.conf /etc/mic/mic.conf +""" +POSTSCRIPTS = """ +sudo mv -f /etc/mic/orig.conf /etc/mic/mic.conf +""" + def PrepEnv(cases_dir, case, work_env): """prepare working env""" for one in glob.glob(os.path.join(cases_dir, 'base', '*')): @@ -30,7 +40,8 @@ def RunandCheck(object, work_env): cwd = os.getcwd() os.chdir(work_env) - os.system("patch -s < ks.p") + os.system(PRESCRIPTS) + #set value of "expect" expect = None if "expect" in os.listdir(work_env): @@ -52,7 +63,8 @@ def RunandCheck(object, work_env): ret =True else: proc.wait() - ret = ImgCheck(work_env) + ret = ImgCheck(work_env) + os.system(POSTSCRIPTS) os.chdir(cwd) try: