diff options
author | Albert Zhang <albert.zhang@canonical.com> | 2014-04-21 21:10:27 +0800 |
---|---|---|
committer | Albert Zhang <albert.zhang@canonical.com> | 2014-04-21 21:10:27 +0800 |
commit | f4547b79a62f675d563c9653a808f9df5ce53921 (patch) | |
tree | 292dddb65b8d7d6c13d5e75ebfc9eedbd4ef6a17 /bin | |
parent | efe8986f88fb6d5b5eeb05b6e8e253113ed3a20f (diff) |
Add stella test cases
Diffstat (limited to 'bin')
-rw-r--r-- | bin/README.md | 9 | ||||
-rwxr-xr-x | bin/custom-executable | 2 | ||||
-rwxr-xr-x | bin/stella_compatibilityChecker | 65 | ||||
-rwxr-xr-x | bin/stella_unity_2d3d_check | 48 |
4 files changed, 113 insertions, 11 deletions
diff --git a/bin/README.md b/bin/README.md deleted file mode 100644 index 55549f3..0000000 --- a/bin/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Container for arbitrary executables needed by tests -=================================================== - -You can execute files from this directory without any additional -setup, they are automatically added to the PATH of the executing -job examples/bin-access for details. - -You should delete this file as anything here is automatically -distributed in the source tarball or installed. \ No newline at end of file diff --git a/bin/custom-executable b/bin/custom-executable deleted file mode 100755 index c911011..0000000 --- a/bin/custom-executable +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "Custom script executed" \ No newline at end of file diff --git a/bin/stella_compatibilityChecker b/bin/stella_compatibilityChecker new file mode 100755 index 0000000..7aaf1cd --- /dev/null +++ b/bin/stella_compatibilityChecker @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# compatibilityChecker - Stella project OEM platform compatibility checker +# Copyright (C) 2013 Penk Chen <penk.chen@canonical.com> +# +# Usage: compatibilityChecker [ -r ] [ -p ] +# -r print release status: Release Version | Development Version | Unsupported Hardware +# -p print platform name + +wget http://10.101.47.249/stella-hw/getID.sh +wget http://10.101.47.249/stella-hw/platform-compatibility-list +mv getID.sh platform-compatibility-list /tmp + +. /tmp/platform-compatibility-list +. /tmp/getID.sh + +usage() { echo "Usage: $0 [ -r ] [ -p ] + -r print release status: Release Version | Development Version | Unsupported Hardware + -p print platform name + -s print system ID +" 1>&2; exit 1; } + +OPTION="release" +while getopts ":rsp" o; do + case "${o}" in + r) OPTION="release"; + ;; + p) echo ${platformLookupTable[$ID]} | cut -d':' -f1; + exit; + ;; + s) echo $ID; + exit; + ;; + *) usage + ;; + esac +done +shift $((OPTIND-1)) + +OUTPUT=`echo ${platformLookupTable[$ID]} | cut -d':' -f1` + +if [ $OPTION == "release" ]; then + if [ ! -z $OUTPUT ]; then + # Got the system ID, checking for GM date + GMDate=`echo ${platformLookupTable[$ID]} | cut -d':' -f2` + + if [ ! -z $GMDate ]; then + GMDateEpoch=`date --date=$GMDate +%s` + OneWeekBeforeGMDateEpoch=`date --date="$GMDate -7 day" +%s` + BuildDate=`tail -n1 /etc/buildstamp | rev | cut -d'-' -f2 | rev` + BuildDateEpoch=`date --date=$BuildDate +%s` + + if [ $BuildDateEpoch -gt $OneWeekBeforeGMDateEpoch ]; then + OUTPUT="Release Version" + else + OUTPUT="Development Version" # not reaching GM yet + fi + else + OUTPUT="Development Version" # GM date not available + fi + else + OUTPUT="Unsupported Hardware" + fi +fi +zenity --info --text="$OUTPUT" +#echo $OUTPUT diff --git a/bin/stella_unity_2d3d_check b/bin/stella_unity_2d3d_check new file mode 100755 index 0000000..87825bd --- /dev/null +++ b/bin/stella_unity_2d3d_check @@ -0,0 +1,48 @@ +#!/bin/sh + +session_status=null +result=0 + +# function to parse session type info into easy-to-understand 2D/3D info + function get_2d3d_info { + # usage: get_2d3d_info session_type_info + if [ "$1" == "ubuntu" ] + then + echo 3D + elif [ "$1" == "ubuntu-2d" ] + then + echo 2D + fi + } + +# get session info + loggedin_session=`cat $HOME/.dmrc | grep Session | cut -f2 -d'='` + running_seesion=$DESKTOP_SESSION # in lightdm's src/display.c: + # $DESKTOP_SESSION is marked "apparently deprecated" + # Its replacement $GDMSESSION is marked "not cross-desktop" + # Might require modification on this part in the future if + # $DESKTOP_SESSION is completely deprecated. + +# parse "logged-in session type" & "$DESKTOP_SESSION type" into easy-to-understand 2D/3D info + # session( session_type_info session_2d3d_type) + expected_session=( $loggedin_session `get_2d3d_info $loggedin_session`) # session selected during user login + actual_session=( $running_seesion `get_2d3d_info $running_seesion`) # session that is actually running + + +# check if "logged in session info" & "desktop_session info" matches + if [ "${expected_session[0]}" == "${actual_session[0]}" ] + then + session_status="MATCHES!" + result=0 + else + session_status="DOES NOT MATCH!" + result=1 + fi + + session_check="User is logged into '${expected_session[0]}' session (${expected_session[1]} mode),\n +session is running in '${actual_session[0]}' (${actual_session[1]} mode).\n +Logged in session and actual running session $session_status" + +# output checked results + zenity --info --text="$session_check" + exit $result |