tizen beta release
[framework/web/wrt-plugins-common.git] / tests / wrt_plugins_commons_test_prepare_db.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 #
5 #    Licensed under the Apache License, Version 2.0 (the "License");
6 #    you may not use this file except in compliance with the License.
7 #    You may obtain a copy of the License at
8 #
9 #        http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #    Unless required by applicable law or agreed to in writing, software
12 #    distributed under the License is distributed on an "AS IS" BASIS,
13 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #    See the License for the specific language governing permissions and
15 #    limitations under the License.
16 #
17 #
18
19 WRT_DB=/opt/dbspace/.wrt.db
20 WRT_DB_BCK=/tmp/wrt.db_backup
21
22 if [ "x$1" == "xstart" ]; then
23     echo start;
24     cp $WRT_DB $WRT_DB_BCK
25     wrt_reset_db.sh;
26
27     #insert some fake widget into to make widget interface dao tests working corectly
28     INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, base_folder, webkit_plugins_required, child_protection, recognized, wac_signed, distributor_signed, min_version, slp_pkgname)";
29     sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(65537, 'w_id_2000', '1.0.0', 100, 200, 'a_name_2000', 'a_email_2000', 'a_href_2000', 'basef_2000', 1, 1, 1, 1, 1, '1.0', 'org.tizen.65537')";
30
31     exit $?
32 elif [ "x$1" == "xstop" ]; then
33     echo stop;
34     cp $WRT_DB_BCK $WRT_DB
35     exit $?
36 else
37     exit 1
38 fi