diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2015-09-17 21:03:27 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2015-09-17 21:03:27 +0800 |
commit | 75cb82c863fdb19ee514f75f841454c9a9fc7c72 (patch) | |
tree | d609b2b7b1aabfa9b3f81cdb3e94720c20a6df0a | |
parent | 2cc06953fdbd31aef372c445219d089722f726be (diff) | |
download | linaro-android-kernel-test-75cb82c863fdb19ee514f75f841454c9a9fc7c72.tar.gz |
delete logger and alarmdev test for 3.18 kernel
since the logger and alarmdev are deleted from 3.18 kernel
Change-Id: I195aa76b7333bd2e4b583603e364725605608bd4
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r-- | alarmdevtest/Android.mk | 21 | ||||
-rw-r--r-- | alarmdevtest/Makefile | 22 | ||||
-rw-r--r-- | alarmdevtest/alarm-dev-test.c | 216 | ||||
-rw-r--r-- | alarmdevtest/android_alarm.h | 54 | ||||
-rwxr-xr-x | linaro-android-kernel-tests.sh | 35 | ||||
-rw-r--r-- | logger/Android.mk | 18 | ||||
-rw-r--r-- | logger/Makefile | 19 | ||||
-rw-r--r-- | logger/logger-dev-test.c | 139 | ||||
-rw-r--r-- | product.mk | 3 |
9 files changed, 1 insertions, 526 deletions
diff --git a/alarmdevtest/Android.mk b/alarmdevtest/Android.mk deleted file mode 100644 index cefd85e..0000000 --- a/alarmdevtest/Android.mk +++ /dev/null @@ -1,21 +0,0 @@ - -############################################################################# -# Copyright (c) 2013 Linaro -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Linaro <linaro-dev@lists.linaro.org> -############################################################################# - - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := alarm-dev-test.c -LOCAL_MODULE := alarm-dev-test -LOCAL_MODULE_TAGS := optional tests - -include $(BUILD_EXECUTABLE) diff --git a/alarmdevtest/Makefile b/alarmdevtest/Makefile deleted file mode 100644 index f8b8fc5..0000000 --- a/alarmdevtest/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################# -# Copyright (c) 2013 Linaro -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Linaro <linaro-dev@lists.linaro.org> -############################################################################# - -CFLAGS += -O3 -Wl,-no-as-needed -LDFLAGS += -lrt -lpthread -bins = alarm-dev-test - - -all: ${bins} - -clean: - rm -f ${bins} - - diff --git a/alarmdevtest/alarm-dev-test.c b/alarmdevtest/alarm-dev-test.c deleted file mode 100644 index 0df40fe..0000000 --- a/alarmdevtest/alarm-dev-test.c +++ /dev/null @@ -1,216 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Linaro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Linaro <linaro-dev@lists.linaro.org> - *******************************************************************************/ - -/* - * alarm-dev-test.c Trivial Android Alarm-dev unit test - * - * By: John Stultz <john.stultz@linaro.org> - * - * For each alarm type, gets, sets and waits for an alarm. - * Then sets the RTC back 10 seconds. - * - * TODO: - */ - -#include <stdio.h> -#include <sys/ioctl.h> -#include <sys/types.h> -#include <fcntl.h> -#include <time.h> -#include <errno.h> -#include <unistd.h> -#include "android_alarm.h" - - -int alarmfd; - -int alarm_set(int type, struct timespec *ts) -{ - return ioctl(alarmfd, ANDROID_ALARM_SET(type), ts); -} - -int alarm_get_time(int type, struct timespec *ts) -{ - return ioctl(alarmfd, ANDROID_ALARM_GET_TIME(type), ts); -} - - -int alarm_set_and_wait(int type, struct timespec *ts) -{ - return ioctl(alarmfd, ANDROID_ALARM_SET_AND_WAIT(type), ts); -} - -int alarm_wait(void) -{ - return ioctl(alarmfd, ANDROID_ALARM_WAIT, 0); -} - -int alarm_clear(int type) -{ - return ioctl(alarmfd, ANDROID_ALARM_CLEAR(type),0); -} - -int alarm_set_rtc(struct timespec *ts) -{ - return ioctl(alarmfd, ANDROID_ALARM_SET_RTC, ts); -} - - -#define DELAY 5 - -int main(void) -{ - struct timespec target, now; - int ret; - int alarm_type; - - if (getuid()) { - printf("Error: Need to run as root\n"); - return -1; - } - - alarmfd = open("/dev/alarm", O_RDWR); - if (alarmfd < 1) { - printf("Error opening /dev/alarm\n"); - return -1; - } - - for (alarm_type = ANDROID_ALARM_RTC_WAKEUP; - alarm_type < ANDROID_ALARM_TYPE_COUNT; alarm_type++) { - ret = alarm_get_time(alarm_type, &now); - if (ret < 0) { - perror("Error: alarm_get_time"); - return -1; - } - printf("(%i) gettime(%i): %ld:%ld\n", ret, alarm_type, now.tv_sec, now.tv_nsec); - - target = now; - target.tv_sec += DELAY; - - ret = alarm_set_and_wait(alarm_type, &target); - if (ret < 0) { - if (errno == EBUSY) { - printf("Warning: EBUSY on alarm_set_and_wait, this is likely due to the " - "Android environment using this alarm type(%d). Skipping.", alarm_type); - continue; - } - perror("Error: alarm_set_and_wait"); - return -1; - } - printf("(0x%x) alarm_set_and_wait(0x%x)\n", ret, alarm_type); - if (!(ret & (1 << alarm_type))) { - printf("Error: alarm_wait: expected bit 0x%x set, got 0x%x", 1 << alarm_type, ret); - return -1; - } - - ret = alarm_get_time(alarm_type, &now); - if (ret < 0) { - perror("Error: alarm_get_time"); - return -1; - } - - if (now.tv_sec < target.tv_sec) { - printf("Error: Early timer return!\n"); - return -1; - } - - if (now.tv_sec > target.tv_sec + 1) { - printf("Error: Late timer return!\n"); - return -1; - } - - target.tv_sec += DELAY; - ret = alarm_set(alarm_type, &target); - if (ret < 0) { - perror("Error: alarm_set"); - return -1; - } - printf("(%i) alarm_set(%i)\n", ret, alarm_type); - - ret = alarm_wait(); - if (ret < 0) { - perror("Error: alarm_wait"); - } - printf("(0x%x) alarm_wait()\n", ret); - if (!(ret & (1 << alarm_type))) { - printf("Error: alarm_wait: expected bit 0x%x set, got 0x%x", 1 << alarm_type, ret); - return -1; - } - - ret = alarm_get_time(alarm_type, &now); - if (ret < 0) { - perror("Error: alarm_get_time"); - return -1; - } - if (now.tv_sec < target.tv_sec) { - printf("Error: Early timer return!\n"); - return -1; - } - if (now.tv_sec > target.tv_sec + 1) { - printf("Error: Late timer return!\n"); - return -1; - } - - ret = alarm_clear(alarm_type); - printf("(%i) alarm_clear()\n", ret); - if (ret < 0) { - perror("Error: alarm_clear"); - return -1; - } - - target.tv_sec += DELAY; - ret = alarm_set(alarm_type, &target); - printf("(%i) alarm_set(%i)\n", ret, alarm_type); - if (ret < 0) { - perror("Error: alarm_set"); - return -1; - } - ret = alarm_clear(alarm_type); - printf("(%i) alarm_clear()\n", ret); - if (ret < 0) { - perror("Error: alarm_clear"); - return -1; - } - } - - - ret = alarm_get_time(ANDROID_ALARM_RTC, &now); - if (ret < 0) { - perror("Error: alarm_get_time"); - return -1; - } - printf("(%i) gettime(ANDROID_ALARM_RTC): %ld:%ld\n", ret, now.tv_sec, now.tv_nsec); - - target = now; - target.tv_sec -= 10; - ret = alarm_set_rtc(&target); - if (ret < 0) { - perror("Error: alarm_set_rtc"); - return -1; - } - printf("(%i) setting rtc back 10 sec (%ld:%ld)\n", ret, target.tv_sec, target.tv_nsec); - - ret = alarm_get_time(ANDROID_ALARM_RTC, &now); - if (ret < 0) { - perror("Error: alarm_get_time"); - return -1; - } - printf("(%i) gettime(ANDROID_ALARM_RTC): %ld:%ld\n", ret, now.tv_sec, now.tv_nsec); - - if (now.tv_sec < target.tv_sec) { - printf("Error: Bad time!\n"); - return -1; - } - - printf("Pass\n"); - - return 0; -} diff --git a/alarmdevtest/android_alarm.h b/alarmdevtest/android_alarm.h deleted file mode 100644 index 5a28d39..0000000 --- a/alarmdevtest/android_alarm.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - **************************************************************************** - *** - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - *** - *** To edit the content of this header, modify the corresponding - *** source file (e.g. under external/kernel-headers/original/) then - *** run bionic/libc/kernel/tools/update_all.py - *** - *** Any manual change here will be lost the next time this script will - *** be run. You've been warned! - *** - **************************************************************************** - ****************************************************************************/ -#ifndef _LINUX_ANDROID_ALARM_H -#define _LINUX_ANDROID_ALARM_H -#include <asm/ioctl.h> -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ -typedef enum { - ANDROID_ALARM_RTC_WAKEUP, - ANDROID_ALARM_RTC, - ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP, -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ - ANDROID_ALARM_ELAPSED_REALTIME, - ANDROID_ALARM_SYSTEMTIME, - ANDROID_ALARM_TYPE_COUNT, -} android_alarm_type_t; -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ -typedef enum { - ANDROID_ALARM_RTC_WAKEUP_MASK = 1U << ANDROID_ALARM_RTC_WAKEUP, - ANDROID_ALARM_RTC_MASK = 1U << ANDROID_ALARM_RTC, - ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP, -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ - ANDROID_ALARM_ELAPSED_REALTIME_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME, - ANDROID_ALARM_SYSTEMTIME_MASK = 1U << ANDROID_ALARM_SYSTEMTIME, - ANDROID_ALARM_TIME_CHANGE_MASK = 1U << 16 -} android_alarm_return_flags_t; -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ -#define ANDROID_ALARM_CLEAR(type) _IO('a', 0 | ((type) << 4)) -#define ANDROID_ALARM_WAIT _IO('a', 1) -#define ANDROID_ALARM_SET(type) _IOW('a', 2 | ((type) << 4), struct timespec) -#define ANDROID_ALARM_SET_AND_WAIT(type) _IOW('a', 3 | ((type) << 4), struct timespec) -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ -#define ANDROID_ALARM_GET_TIME(type) _IOW('a', 4 | ((type) << 4), struct timespec) -#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) -#define ANDROID_ALARM_SET_TIMEZONE _IOW('a', 6, struct timezone) -#define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) -/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ -#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) -#endif diff --git a/linaro-android-kernel-tests.sh b/linaro-android-kernel-tests.sh index 5dba5c0..e23550d 100755 --- a/linaro-android-kernel-tests.sh +++ b/linaro-android-kernel-tests.sh @@ -20,8 +20,6 @@ usage() { echo " currently supported:" echo " ashmem" echo " ashmem_expanded" - echo " alarmdev" - echo " logger" echo " binder" echo " sync" echo " vfat" @@ -68,39 +66,6 @@ run_ashmemtest_expanded() done } -run_alarm_dev_test() -{ - echo "Running alarm dev test." - stop - sleep 20 - alarm-dev-test - start - sleep 60 - - if [ $? -eq 0 ]; then - echo "[alarmdevtest]: test passed" - else - echo "[alarmdevtest]: test failed" - fi -} - -run_logger_test() -{ - echo "Running logger dev test." - - for log in main events radio system - do - echo "Running for log: $log" - loggerdevtest $log - - if [ $? -eq 0 ]; then - echo "[loggerdevtest_$log]: test passed" - else - echo "[loggerdevtest_$log]: test failed" - fi -done -} - run_binder_test() { echo "Running binder test." bindertest.sh diff --git a/logger/Android.mk b/logger/Android.mk deleted file mode 100644 index c1a4c05..0000000 --- a/logger/Android.mk +++ /dev/null @@ -1,18 +0,0 @@ -############################################################################# -# Copyright (c) 2013 Linaro -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Linaro <linaro-dev@lists.linaro.org> -############################################################################# - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE_TAGS := optional tests -LOCAL_MODULE := loggerdevtest -LOCAL_SRC_FILES := logger-dev-test.c -include $(BUILD_EXECUTABLE) diff --git a/logger/Makefile b/logger/Makefile deleted file mode 100644 index 985628e..0000000 --- a/logger/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -############################################################################# -# Copyright (c) 2013 Linaro -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Linaro <linaro-dev@lists.linaro.org> -############################################################################# - -CFLAGS = -O2 -g -CFLAGS += -DUBUNTU_LOGGER - -logger-dev-test: logger-dev-test.c - $(CC) $(CFLAGS) -o $@ $< - -clean: - $(RM) logger-dev-test diff --git a/logger/logger-dev-test.c b/logger/logger-dev-test.c deleted file mode 100644 index c646f7c..0000000 --- a/logger/logger-dev-test.c +++ /dev/null @@ -1,139 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Linaro - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Linaro <linaro-dev@lists.linaro.org> - *******************************************************************************/ - -/* - * logger-dev-test.c Trivial Android logger-dev unit test - * - * By: AppalaNaidu Bade <appala.bade@linaro.org> - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <fcntl.h> -#include <sys/ioctl.h> -#include <string.h> -#include <unistd.h> - -#ifdef UBUNTU_LOGGER - -#define LOGGER_LOG_RADIO "/dev/log_radio" -#define LOGGER_LOG_EVENTS "/dev/log_events" -#define LOGGER_LOG_SYSTEM "/dev/log_system" -#define LOGGER_LOG_MAIN "/dev/log_main" - -#else - -#define LOGGER_LOG_RADIO "/dev/log/radio" -#define LOGGER_LOG_EVENTS "/dev/log/events" -#define LOGGER_LOG_SYSTEM "/dev/log/system" -#define LOGGER_LOG_MAIN "/dev/log/main" - -#endif // UBUNTU_LOGGER - -#define __LOGGERIO 0xAE -#define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */ -#define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */ -#define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */ -#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */ -#define LOGGER_GET_VERSION _IO(__LOGGERIO, 5) /* abi version */ -#define LOGGER_SET_VERSION _IO(__LOGGERIO, 6) /* abi version */ - -void show_help() -{ - printf("Usage:\n loggerdevtest logdevicename(main/events/radio/system)\n\n"); - return; -} - -int clearlog(int logfd) -{ - return ioctl(logfd, LOGGER_FLUSH_LOG); -} - -int getlogsize(int logfd) -{ - return ioctl(logfd, LOGGER_GET_LOG_BUF_SIZE); -} - -int getlogreadablesize(int logfd) -{ - return ioctl(logfd, LOGGER_GET_LOG_LEN); -} - -int getlognextentrysize(int logfd) -{ - return ioctl(logfd, LOGGER_GET_NEXT_ENTRY_LEN); -} - -int main(int argc, char *argv[]) -{ - char *logdevicename; - int log_fd; - int log_ret; - - if (argc !=2) { - show_help(); - exit(0); - } - if (strcmp(argv[argc-1],"help") == 0) { - show_help(); - exit(0); - } - if(strcmp(argv[argc-1],"main")==0) - logdevicename = LOGGER_LOG_MAIN; - else if(strcmp(argv[argc-1], "events")==0) - logdevicename = LOGGER_LOG_EVENTS; - else if(strcmp(argv[argc-1], "radio")==0) - logdevicename = LOGGER_LOG_RADIO; - else if(strcmp(argv[argc-1], "system")==0) - logdevicename = LOGGER_LOG_SYSTEM; - else { - printf("wrong input check usage and try again\n"); - exit(0); - } - - log_fd = open(logdevicename,O_RDWR); - if (log_fd < 0) { - printf("FAIL :Failed to open %s \n",logdevicename); - exit(EXIT_FAILURE); - } else - printf("PASS :Able to open %s logdevice and fd is %d\n", logdevicename,log_fd); - - log_ret = getlogsize(log_fd); - if(log_ret < 0) { - printf("FAIL : Failed to get %s logdevice size \n ", logdevicename); - perror("ioctl:\n"); - } else - printf("PASS : %s logdevice size = %d\n",logdevicename,log_ret); - log_ret = getlogreadablesize(log_fd); - if(log_ret < 0){ - printf("FAIL : Failed to get %s logdevice readablesize\n", logdevicename); - perror("ioctl:\n"); - } else - printf("PASS : %s logdevice readablesize = %d\n", logdevicename,log_ret); - log_ret = getlognextentrysize(log_fd); - if(log_ret < 0) { - printf("FAIL : Failed to get %s logdevice size of next log entry\n" , logdevicename); - perror("ioctl:\n"); - } else - printf("PASS : %s logdevice size of next log entry = %d\n", logdevicename,log_ret); - - log_ret = clearlog(log_fd); - if(log_ret) { - printf("FAIL : Failed to clear the log of data %s logdevice\n" , logdevicename); - perror("ioctl:\n"); - } else - printf("PASS : clears the log of data %s logdevice\n" , logdevicename); - close(log_fd); - exit(0); - -} - @@ -13,13 +13,12 @@ PRODUCT_PACKAGES += alarm-dev-test \ ashmemtest \ ashmemtest-expanded \ - loggerdevtest \ sync-basic \ nl-listener \ vfat-volid dosfstools \ mkfs.vfat \ binderAddInts \ - swp-test-static + swp-test-static PRODUCT_COPY_FILES += external/linaro-android-kernel-test/binder/bindertest.sh:system/bin/bindertest.sh PRODUCT_COPY_FILES += external/linaro-android-kernel-test/linaro-android-kernel-tests.sh:system/bin/linaro-android-kernel-tests.sh |