[UTC][capi-appfw-alarm][non-ACR][improves alarm TC] 85/208285/1
authorInkyun Kil <inkyun.kil@samsung.com>
Fri, 21 Jun 2019 05:59:02 +0000 (14:59 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Fri, 21 Jun 2019 06:00:21 +0000 (15:00 +0900)
Change-Id: I35b53507b9befaf9109ccf3f5bbc9c9f9b3bf0f0
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
17 files changed:
src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-aarch64.tpk
src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-arm.tpk
src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-i386.tpk
src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-x86_64.tpk
src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-aarch64.tpk
src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-arm.tpk
src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-i386.tpk
src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-x86_64.tpk
src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-aarch64.tpk
src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-arm.tpk
src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-i386.tpk
src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-x86_64.tpk
src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-aarch64.tpk
src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-arm.tpk
src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-i386.tpk
src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-x86_64.tpk
src/utc/alarm/utc_alarm.c

index d2100493c55a248e97fa077242785f10ee87cf7e..9bfd01be472868d8aa4886954d68ffe93f59a2d6 100755 (executable)
Binary files a/src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-aarch64.tpk and b/src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-aarch64.tpk differ
index 502b223141acb1b7fc7d0f139437a72bc9ee00d6..ebad781c212670ec965b80ccba9e1347789445e0 100755 (executable)
Binary files a/src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-arm.tpk and b/src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-arm.tpk differ
index 8569cb7ce150a8a310467935b4597b3fe1190611..f832939eb1a3addabdd2a03b3e71814d613a7a7d 100755 (executable)
Binary files a/src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-i386.tpk and b/src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-i386.tpk differ
index cef7ec04be6bf3b167c0388510c2b90b2db0d35d..8282d7ec7321cc7042c7d37b14b62bf1317c8ba9 100755 (executable)
Binary files a/src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-x86_64.tpk and b/src/utc/alarm/res/mobile/org.tizen.helloworld-1.0.0-x86_64.tpk differ
index d2100493c55a248e97fa077242785f10ee87cf7e..9bfd01be472868d8aa4886954d68ffe93f59a2d6 100755 (executable)
Binary files a/src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-aarch64.tpk and b/src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-aarch64.tpk differ
index 502b223141acb1b7fc7d0f139437a72bc9ee00d6..ebad781c212670ec965b80ccba9e1347789445e0 100755 (executable)
Binary files a/src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-arm.tpk and b/src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-arm.tpk differ
index 8569cb7ce150a8a310467935b4597b3fe1190611..f832939eb1a3addabdd2a03b3e71814d613a7a7d 100755 (executable)
Binary files a/src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-i386.tpk and b/src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-i386.tpk differ
index cef7ec04be6bf3b167c0388510c2b90b2db0d35d..8282d7ec7321cc7042c7d37b14b62bf1317c8ba9 100755 (executable)
Binary files a/src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-x86_64.tpk and b/src/utc/alarm/res/tizeniot/org.tizen.helloworld-1.0.0-x86_64.tpk differ
index d2100493c55a248e97fa077242785f10ee87cf7e..9bfd01be472868d8aa4886954d68ffe93f59a2d6 100755 (executable)
Binary files a/src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-aarch64.tpk and b/src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-aarch64.tpk differ
index 502b223141acb1b7fc7d0f139437a72bc9ee00d6..ebad781c212670ec965b80ccba9e1347789445e0 100755 (executable)
Binary files a/src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-arm.tpk and b/src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-arm.tpk differ
index 8569cb7ce150a8a310467935b4597b3fe1190611..f832939eb1a3addabdd2a03b3e71814d613a7a7d 100755 (executable)
Binary files a/src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-i386.tpk and b/src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-i386.tpk differ
index cef7ec04be6bf3b167c0388510c2b90b2db0d35d..8282d7ec7321cc7042c7d37b14b62bf1317c8ba9 100755 (executable)
Binary files a/src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-x86_64.tpk and b/src/utc/alarm/res/tv/org.tizen.helloworld-1.0.0-x86_64.tpk differ
index d2100493c55a248e97fa077242785f10ee87cf7e..9bfd01be472868d8aa4886954d68ffe93f59a2d6 100755 (executable)
Binary files a/src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-aarch64.tpk and b/src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-aarch64.tpk differ
index 502b223141acb1b7fc7d0f139437a72bc9ee00d6..ebad781c212670ec965b80ccba9e1347789445e0 100755 (executable)
Binary files a/src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-arm.tpk and b/src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-arm.tpk differ
index 8569cb7ce150a8a310467935b4597b3fe1190611..f832939eb1a3addabdd2a03b3e71814d613a7a7d 100755 (executable)
Binary files a/src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-i386.tpk and b/src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-i386.tpk differ
index cef7ec04be6bf3b167c0388510c2b90b2db0d35d..8282d7ec7321cc7042c7d37b14b62bf1317c8ba9 100755 (executable)
Binary files a/src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-x86_64.tpk and b/src/utc/alarm/res/wearable/org.tizen.helloworld-1.0.0-x86_64.tpk differ
index 64efb35b4854088ec7709902a171300905e49599..3f991a32ebcd6497cee3503cd1cf28283cedc419 100755 (executable)
@@ -92,6 +92,33 @@ static bool foreach_alarm_cb(int alarm, void *user_data)
        return true;
 }
 
+static gboolean __alarm_check(gpointer data)
+{
+       app_control_h app_control = (app_control_h)data;
+       int ret;
+       bool is_running = false;
+       const char *app_id = "org.tizen.helloworld";
+
+       ret = app_manager_is_running(app_id, &is_running);
+       assert_eq_with_exit(ret, APP_MANAGER_ERROR_NONE);
+
+       if (is_running) {
+               ret = app_control_add_extra_data(app_control, "ALARM_UTC", "TERM");
+               assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+
+               ret = app_control_send_launch_request(app_control, NULL, NULL);
+               assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+
+               normal_exit(0);
+       } else {
+               normal_exit(1);
+       }
+
+       app_control_destroy(app_control);
+       alarm_cancel_all();
+       return true;
+}
+
 /**
  * @testcase           utc_alarm_schedule_after_delay_p
  * @since_tizen                2.3
@@ -331,7 +358,7 @@ int utc_alarm_schedule_once_after_delay_p(void)
        app_control_h app_control;
        int tid;
        int ret = ALARM_ERROR_NONE;
-       int delay = 1;
+       int delay = 5;
        const char *app_id = "org.tizen.helloworld";
 
        ret = app_control_create(&app_control);
@@ -344,12 +371,9 @@ int utc_alarm_schedule_once_after_delay_p(void)
        assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
 
        ret = alarm_schedule_once_after_delay(app_control, delay, &tid);
-
-       app_control_destroy(app_control);
-       alarm_cancel_all();
-
        assert_eq_with_exit(ret, ALARM_ERROR_NONE);
-       normal_exit(0);
+
+       g_timeout_add_seconds(10, __alarm_check, app_control);
 
        return 0;
 }
@@ -441,7 +465,8 @@ int utc_alarm_cancel_p(void)
        int ret2 = ALARM_ERROR_NONE;
        int tid;
        int delay = 1;
-       int period = 1;
+       int period = 5;
+       bool is_running = false;
        const char *app_id = "org.tizen.helloworld";
 
        ret = app_control_create(&app_control);
@@ -456,6 +481,12 @@ int utc_alarm_cancel_p(void)
        ret1 = alarm_schedule_after_delay(app_control, delay, period, &tid);
        ret2 = alarm_cancel(tid);
 
+       sleep(10);
+
+       ret = app_manager_is_running(app_id, &is_running);
+       assert_eq_with_exit(ret, APP_MANAGER_ERROR_NONE);
+       assert_eq_with_exit(is_running, false);
+
        app_control_destroy(app_control);
        alarm_cancel_all();
 
@@ -578,13 +609,18 @@ int utc_alarm_foreach_registered_alarm_n(void)
 int utc_alarm_get_scheduled_date_p(void)
 {
        struct tm date;
+       struct tm get_date;
        app_control_h app_control;
        int ret = ALARM_ERROR_NONE;
        int tid;
-       int delay = 1;
-       int period = 5;
+       time_t now;
        const char *app_id = "org.tizen.helloworld";
 
+       time(&now);
+       now += 20;
+       tzset();
+       localtime_r(&now, &date);
+
        ret = app_control_create(&app_control);
        assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
 
@@ -594,14 +630,17 @@ int utc_alarm_get_scheduled_date_p(void)
        ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
        assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
 
-       alarm_schedule_after_delay(app_control, delay, period, &tid);
+       ret = alarm_schedule_once_at_date(app_control, &date, &tid);
+       assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
+
+       ret = alarm_get_scheduled_date(tid, &get_date);
+       assert_eq_with_exit(ret, ALARM_ERROR_NONE);
 
-       ret = alarm_get_scheduled_date(tid, &date);
+       assert_eq_with_exit(date.tm_sec, get_date.tm_sec);
 
        app_control_destroy(app_control);
        alarm_cancel_all();
 
-       assert_eq_with_exit(ret, ALARM_ERROR_NONE);
        normal_exit(0);
 
        return 0;
@@ -707,11 +746,10 @@ int utc_alarm_schedule_once_at_date_p(void)
        app_control_h app_control;
        int tid;
        const char *app_id = "org.tizen.helloworld";
-
        int ret = ALARM_ERROR_NONE;
 
        time(&now);
-       now += 20;
+       now += 5;
        tzset();
        localtime_r(&now, &date);
 
@@ -726,11 +764,7 @@ int utc_alarm_schedule_once_at_date_p(void)
 
        ret = alarm_schedule_once_at_date(app_control, &date, &tid);
 
-       app_control_destroy(app_control);
-       alarm_cancel_all();
-
-       assert_eq_with_exit(ret, ALARM_ERROR_NONE);
-       normal_exit(0);
+       g_timeout_add_seconds(10, __alarm_check, app_control);
 
        return 0;
 }
@@ -876,7 +910,7 @@ int utc_alarm_schedule_with_recurrence_week_flag_p(void)
        time(&now);
        tzset();
        localtime_r(&now, &date);
-       date.tm_sec += 3;
+       date.tm_sec += 5;
 
        ret = app_control_create(&app_control);
        assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
@@ -887,13 +921,13 @@ int utc_alarm_schedule_with_recurrence_week_flag_p(void)
        ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
        assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
 
-       ret = alarm_schedule_with_recurrence_week_flag(app_control, &date, ALARM_WEEK_FLAG_MONDAY, &tid);
-
-       app_control_destroy(app_control);
-       alarm_cancel_all();
+       ret = alarm_schedule_with_recurrence_week_flag(app_control, &date,
+                       ALARM_WEEK_FLAG_MONDAY | ALARM_WEEK_FLAG_TUESDAY |
+                       ALARM_WEEK_FLAG_WEDNESDAY | ALARM_WEEK_FLAG_THURSDAY |
+                       ALARM_WEEK_FLAG_FRIDAY | ALARM_WEEK_FLAG_SATURDAY |
+                       ALARM_WEEK_FLAG_SUNDAY, &tid);
 
-       assert_eq_with_exit(ret, ALARM_ERROR_NONE);
-       normal_exit(0);
+       g_timeout_add_seconds(10, __alarm_check, app_control);
 
        return 0;
 }
@@ -1950,8 +1984,6 @@ int utc_alarm_update_delay_p(void)
        app_control_h app_control;
        int alarm_id;
        int ret = ALARM_ERROR_NONE;
-       int delay = 1;
-       int period = 1;
        const char *app_id = "org.tizen.helloworld";
 
        ret = app_control_create(&app_control);