Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f33b0c12 authored by Richard Uhler's avatar Richard Uhler Committed by Android (Google) Code Review
Browse files

Merge "Initial setup of a SystemMemoryTest."

parents 909e3bb6 e9444bf9
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
# Copyright (C) 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

LOCAL_PATH:= $(call my-dir)

include $(call all-subdir-makefiles)
+21 −0
Original line number Diff line number Diff line
This directory contains a test for system server memory use.

Directory structure
===================
device
  - those parts of the test that run on device.

host
  - those parts of the test that run on host.

Running the test
================

You can manually run the test as follows:

  make tradefed-all system-memory-test SystemMemoryTestDevice
  tradefed.sh run commandAndExit template/local_min --template:map test=system-memory-test

This installs and runs the test on device. You can see the metrics in the
tradefed output.
+24 −0
Original line number Diff line number Diff line
# Copyright (C) 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
LOCAL_PACKAGE_NAME := SystemMemoryTestDevice
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_COMPATIBILITY_SUITE := general-tests
include $(BUILD_PACKAGE)
+30 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.tests.sysmem.device">

    <uses-sdk android:minSdkVersion="19" />

    <instrumentation
            android:name="com.android.tests.sysmem.device.Cujs"
            android:targetPackage="com.android.tests.sysmem.device" />

    <application
            android:allowBackup="false"
            android:label="System Memory Test">
    </application>
</manifest>
+53 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.tests.sysmem.device;

import android.app.Activity;
import android.app.Instrumentation;
import android.os.Bundle;
import android.util.Log;

/**
 * Critical user journeys used to exercise the system for test, driven from
 * the device.
 */
public class Cujs extends Instrumentation {

    private static final String TAG = "SystemMemoryTest";

    @Override
    public void onCreate(Bundle arguments) {
        start();
    }

    @Override
    public void onStart() {
        // TODO: Exercise the system in more interesting ways.
        // Mostly what matters is that whatever we do here is sustainable: it
        // can be repeated indefinitely on the system without causing
        // problems.  For example, launching activities is fine. Installing
        // applications is only fine if we also uninstall them as part of the
        // test.
        try {
            Log.i(TAG, "Sleeping for 10 seconds...");
            Thread.sleep(10 * 1000);
        } catch (InterruptedException ignored) {
        }

        finish(Activity.RESULT_OK, null);
    }
}
Loading