Commit Graph

220 Commits

Author SHA1 Message Date
Yu Shan Emily Lau
6a6c533129 Add the simple script log for the statbility stress test.
Add the randomize script option.

Change-Id: I7fbbd3b78a2fc5fe5300ac4811540d0cd2070688
2010-08-30 15:31:33 -07:00
Yu Shan Emily Lau
f1598c4cf4 am ea7d6e8e: Merge "Add the new option for the device sleep time. This is only for the scripted monkey." into gingerbread
Merge commit 'ea7d6e8e6568b777693c52183e9abf973786a6b5' into gingerbread-plus-aosp

* commit 'ea7d6e8e6568b777693c52183e9abf973786a6b5':
  Add the new option for the device sleep time. This is only for the scripted monkey.
2010-08-26 15:27:57 -07:00
Yu Shan Emily Lau
9ab015751d Add the new option for the device sleep time. This is only for the scripted monkey.
Change-Id: I4a6bd7133bbd2da9594a47e1f5529c5358cd9aed
2010-08-26 14:18:18 -07:00
Brad Fitzpatrick
616acdb9cd am 06bcd705: Quiet harmless StrictMode violations caused by the Monkey.
Merge commit '06bcd705606070aa71425fc557e72592a2405a0a' into gingerbread-plus-aosp

* commit '06bcd705606070aa71425fc557e72592a2405a0a':
  Quiet harmless StrictMode violations caused by the Monkey.
2010-08-25 10:10:40 -07:00
Brad Fitzpatrick
06bcd70560 Quiet harmless StrictMode violations caused by the Monkey.
The monkey writes to System.out which is effectively a file and is
caught by StrictMode.

BUG=2947447

Change-Id: Iab38917f18baa319dad34d0c788bc9a10a041796
2010-08-25 09:45:49 -07:00
Yu Shan Emily Lau
6fae0ba472 am 27d0ec1e: Merge "Add the new option for the scripted monkey profile testing." into gingerbread
Merge commit '27d0ec1e87dcf41960f87f203c1822e88f99ea38' into gingerbread-plus-aosp

* commit '27d0ec1e87dcf41960f87f203c1822e88f99ea38':
  Add the new option for the scripted monkey profile testing.
2010-08-24 20:10:38 -07:00
Yu Shan Emily Lau
6035a57a97 Add the new option for the scripted monkey profile testing.
Change-Id: I1013a1a0daed948f509d9a29077f0e282baf1a10
2010-08-24 19:49:38 -07:00
Yu Shan Emily Lau
599fcd2199 am 3307fdcc: Merge "Added the new keyword tap for the scripted monkey." into gingerbread
Merge commit '3307fdcce1f322ed72cc3d3a8d9da87aae856531' into gingerbread-plus-aosp

* commit '3307fdcce1f322ed72cc3d3a8d9da87aae856531':
  Added the new keyword tap for the scripted monkey.
2010-08-19 15:49:25 -07:00
Yu Shan Emily Lau
39b0199222 Added the new keyword tap for the scripted monkey.
Change-Id: Iabfc462f8fc853b3235aa0d742fa46c97e980b77
2010-08-19 15:01:38 -07:00
Yu Shan Emily Lau
2929dce37a am b409cf9c: Merge "Add the monkey event which allows the scripted monkey to execute the shell command." into gingerbread
Merge commit 'b409cf9ca1251df1145139580f6809364fb3881f' into gingerbread-plus-aosp

* commit 'b409cf9ca1251df1145139580f6809364fb3881f':
  Add the monkey event which allows the scripted monkey to execute the shell command.
2010-08-19 11:14:05 -07:00
Yu Shan Emily Lau
4fbc8db891 Add the monkey event which allows the scripted monkey to execute the shell command.
Change-Id: Id5548fc42fc5c7bee6879fffc580e134a75572ab
2010-08-19 11:03:34 -07:00
Jean-Baptiste Queru
8930942de2 am 4388d2c3: Merge "Monkey: Set the name of the process to distinguish from generic name (app_process)"
Merge commit '4388d2c333c164ce67db6d4a59cded8dfea9fc9a' into gingerbread-plus-aosp

* commit '4388d2c333c164ce67db6d4a59cded8dfea9fc9a':
  Monkey: Set the name of the process to distinguish from generic name (app_process)
2010-08-16 13:16:44 -07:00
Ying Wang
a27eb4c7d9 am 8fc77898: Fix keycode. [Cherry-pick from master]
Merge commit '8fc778984cd0b737df102fca14be7c1815505b80' into gingerbread-plus-aosp

* commit '8fc778984cd0b737df102fca14be7c1815505b80':
  Fix keycode. [Cherry-pick from master]
2010-08-12 13:14:11 -07:00
Ying Wang
8fc778984c Fix keycode. [Cherry-pick from master]
see frameworks/base/core/java/android/view/KeyEvent.java.

Change-Id: Ic9a355b36815c4ac7db9c57c14bfe933585cf963
http://b/issue?id=2830562
2010-08-12 11:30:41 -07:00
Vairavan Srinivasan
83c57574b7 Monkey: Set the name of the process to distinguish from generic name (app_process)
Change-Id: If58ff437bfbea421dc00a2d85547267c010871e4
2010-08-03 10:00:55 -07:00
Vairavan Srinivasan
474fe56acc am 688e62cd: Monkey: Changes to release lock before reporting ANR and meminfo
Merge commit '688e62cd116d0bc17ad162915908764c67dd6045' into gingerbread-plus-aosp

* commit '688e62cd116d0bc17ad162915908764c67dd6045':
  Monkey: Changes to release lock before reporting ANR and meminfo
2010-07-22 09:30:38 -07:00
Vairavan Srinivasan
688e62cd11 Monkey: Changes to release lock before reporting ANR and meminfo
Report ANR, dumpsys after releasing lock on Monkey.this.
This ensures the availability of the lock to Activity controller's
appNotResponding.

Reporting dumpsys while holding the lock on this causes a cyclic
deadlock, when twoANRs are reported (one after the other).

Monkey's ActivityController is registered to ActivityManagerService
for handling ANR.The first ANR caused by either service timeout or
broadcast timeout is reported byActivityManagerService to Monkey's
ActivityController via Binder. Meanwhile, the lock on
ActivityManagerService is held by serviceTimeout or broadcastTimeout.

appNotResponding corresponding to first ANR reports procrank and
acquires a lock onMonkey.this and sets few bool variables like
mRequestAnrTraces and mRequestDumpsysMemInfoand returns the control
to ActivityManagerService's service/broadcast timeout.
VM executing monkey process switches the control to main monkey
thread and it acquires thelock on Monkey.this and proceeds to report
ANR traces.

Meanwhile, a second ANR occurs and Activity Manager Service invokes
ActivityController's appNotResponding (via binder). appNotResponding
reports the procrank and waits to acquire the lock on Monkey.this
which is being held by Monkey's main thread(busy reporting first ANR).
This results in a blocking wait for ActivityManagerService's
appNotRespondingLocked() (corresponding to second ANR).

Meanwhile, the monkey's main thread (holding lock on Monkey.this)
tries to report the meminfo for first ANR, invokes
reportDumpsysMemInfo(), which in turn causes the android runtime to
launch dumpsys process. The dumpsys process queries service manager
to get a reference to meminfo service and invoke dump() on the same.
The meminfo service is created by ActivityManagerService's
setSystemProcess(). The dump() method tries to acquire a lock on
ActivityManagerService which is held by ActivityManagerService's
service/broadcasttimeout (awaiting the response from
ActivityController for the second ANR).

This cyclic deadlock continues for a minute after which WatchDog
thread of system_server kills system_server as it hasn't got the
response from ActivityManagerService's monitor(). The monitor()
of ActivityManagerService too tries to acquire lock on this and is
invoked once in every minute.

DEADLOCK:
--------

ActivityManager --> ActivityController  --> Monkey Main  --> MemInfo
--> ActivityManager

Change-Id: I7718eff332e5551b1950ab1c45395bf1ff4b1bda
2010-07-20 16:07:25 -07:00
Ying Wang
5ce45c93ad Fix keycode
4 new key codes were added since gingerbread.
bug: http://b/issue?id=2830562

Change-Id: I91a55ef6ca9244bc053e25b6dd8d514cb3f106e9
2010-07-09 15:07:19 -07:00
Yu Shan Emily Lau
ec87ca5f3a am 34ca4b64: Merge "Add the support for the alarmManager and force the device to wake up." into froyo
Merge commit '34ca4b646b20cc209b06fec482e6c77dbc92d220' into gingerbread

* commit '34ca4b646b20cc209b06fec482e6c77dbc92d220':
  Add the support for the alarmManager and force the device to wake up.
2010-07-08 11:31:07 -07:00
Yu Shan Emily Lau
52bbaa3052 Add the support for the alarmManager and force the device to wake up.
Change-Id: Ib4a2f9cb580eadf6771b103399e14f932d50cb1c
2010-07-07 12:13:32 -07:00
Yu Shan Emily Lau
a96f73a683 am 1a132581: Merge "Add the AUTOTEST_TEST_BEGIN_DELAY keyword to the scripted monkey which allow the power log to start 10 seconds after the event was send out." into froyo
Merge commit '1a132581a5ce6188989d8522d227392c05cb42f6' into froyo-plus-aosp

* commit '1a132581a5ce6188989d8522d227392c05cb42f6':
  Add the AUTOTEST_TEST_BEGIN_DELAY keyword to the scripted monkey which allow the power log to start 10 seconds after the event was send out.
2010-06-24 15:42:29 -07:00
Yu Shan Emily Lau
3bacdf9300 am 1a132581: Merge "Add the AUTOTEST_TEST_BEGIN_DELAY keyword to the scripted monkey which allow the power log to start 10 seconds after the event was send out." into froyo
Merge commit '1a132581a5ce6188989d8522d227392c05cb42f6' into gingerbread

* commit '1a132581a5ce6188989d8522d227392c05cb42f6':
  Add the AUTOTEST_TEST_BEGIN_DELAY keyword to the scripted monkey which allow the power log to start 10 seconds after the event was send out.
2010-06-24 15:41:10 -07:00
Yu Shan Emily Lau
07aeb8c358 Add the AUTOTEST_TEST_BEGIN_DELAY keyword to the scripted monkey which allow the power log to start 10 seconds after the event was send out.
Change-Id: I3d98d56128b8a96ba712c7e11280e3ab88a7cc4a
2010-06-24 14:20:16 -07:00
Yu Shan Emily Lau
59b6dce0d5 am 39d7a745: Merge "Added the instrumentation and power log monkey events fro the new power framework." into froyo
Merge commit '39d7a7451b7e43dc1d71ac983821e76c88775a81' into froyo-plus-aosp

* commit '39d7a7451b7e43dc1d71ac983821e76c88775a81':
  Added the instrumentation and power log monkey events fro the new power framework.
2010-05-28 15:50:23 -07:00
Yu Shan Emily Lau
2952b49c7c Added the instrumentation and power log monkey events fro the new power framework.
Change-Id: I3102e6caaba8763a2197ff80f13c8d127ea42316
2010-05-28 13:48:42 -07:00
The Android Open Source Project
99096976d0 merge from open-source master
Change-Id: I4bbf0fccef174a7f0eb8241b422f846ea21c3349
2010-05-12 09:27:49 -07:00
Johan Alfven
f515f1a6c8 Added missing --pct-syskeys to processOptions in Monkey
According to the developer guidelines
http://developer.android.com/guide/developing/tools/monkey.html
it should be possible to run monkey with option --pct-syskeys <percent>
to adjust percentage of "system" key events. (These are keys that are
generally reserved for use by the system, such as Home, Back,
Start Call, End Call, or Volume controls.) However, when trying
to run monkey with that option it fails with:
** Error: Unknown option: --pct-syskeys
The function processOptions in file Monkey.java was missing the
option --pct-syskeys.

Change-Id: I5d328fc93dfe67ed7a905735d6762c7f91c69838
2010-05-11 09:11:43 +02:00
Ying Wang
84086578bb Add timestamp to monkey log
Change-Id: Ia477aca8b00d06049621d848f5792c291e3db040
2010-04-14 19:25:27 -07:00
Ying Wang
9731732fe6 Move potentially blocking operation out of the activity controller.
http://b/viewIssue?id=2497953
before this CL, call to reportProcRank() in the controller waited for the
procrank process to finish, which potentially would block the activity
manager and cause deadlock between the activity manager and the window manager.

Change-Id: Ie5a6aae7c8dbe43ac725abdb04f2426f54dd6740
2010-04-01 14:12:25 -07:00
Ying Wang
df78cdf2d3 Support for ignoring or exit running when native crashes.
http://b/issue?id=2359586
with this CL, if --monitor-native-crashes is set and --ignore-native-crashes
is not set, monkey will exit when a native crash occurs.

Change-Id: I07ab17b5430ed090d8fb6286fdc793bac1b2caa9
2010-03-09 15:21:26 -08:00
Ying Wang
a08e19c3f9 Fix bug.
Bug due to code migration.
2010-02-01 16:15:59 -08:00
Ying Wang
bae4515153 Add support for random throttle.
See http://b/1716328
2010-02-01 11:41:29 -08:00
Eric Rowe
d98ba32eef DO NOT MERGE Fix bug where monkey always tries to run multiple scripts.
Change condition so MonkeySourceRandromScript is only triggered on multiple
scripts.
2010-01-14 17:09:19 -08:00
Eric Rowe
7d961f8620 DO NOT MERGE Create way to run monkey with multiple scripts.
By giving multiple -f arguments, the monkey will randomly choose between the
scripts.  Also, add the --setup argument which will run a setup script before
starting to play the other scripts in random order.
2010-01-14 17:04:27 -08:00
Eric Rowe
66e263baed Fix how the monkey counts events for scripts.
Instead of the monkey counting up to the count times the number of events in the
script, the monkey will now only increment the count when the script reaches the
end of the file.  This allows us to have multiple script files with differing
event counts in each.

Conflicts:

	cmds/monkey/src/com/android/commands/monkey/Monkey.java
2010-01-13 18:22:32 -08:00
Eric Rowe
b2fa770013 DO NOT MERGE Modify Monkey so that scripts can use raw and user events.
Fix javadoc comment in MonkeySourceRandom.java and combine raw events and user
events in MonkeySourceScript.java.  Also, fix bug where too few arguments in
the script causes a RuntimeException.
2010-01-13 15:07:08 -08:00
Ying Wang
9a7ff5b7ce resolved conflicts for merge of 494d8698 to master 2010-01-08 20:47:07 -08:00
Ying Wang
7e3d678570 Fixes bug of the number of injected monkey events.
Returns the actual events number that has been injected,
if any system error has occurred.
2010-01-08 18:26:53 -08:00
Ying Wang
36d415e122 am 19e2f60e: am 9c7692aa: Set ro.monkey if it\'s not set yet.
Merge commit '19e2f60e4f850661342ff24a87c11f81cb2f2dea'

* commit '19e2f60e4f850661342ff24a87c11f81cb2f2dea':
  Set ro.monkey if it's not set yet.
2010-01-06 13:56:06 -08:00
Ying Wang
9c7692aabb Set ro.monkey if it's not set yet.
http://b/issue?id=1681101
2010-01-06 10:16:55 -08:00
Ying Wang
60dc137675 resolved conflicts for merge of e3b115d0 to master 2010-01-04 13:37:36 -08:00
Ying Wang
48f0d8993b Annouce that Monkey is running.
http://b/issue?id=1681101
2010-01-04 11:51:56 -08:00
Dan Egnor
1e9eb6722c Add some more buttons to Bad Behavior:
- crash system server
- report a Log.wtf()

Update Monkey for changes to IActivityController interface.
2009-12-21 15:32:57 -08:00
Ying Wang
dc388c565b Merge commit 'goog/eclair-mr2' into play-with-monkey
Conflicts:

	cmds/monkey/src/com/android/commands/monkey/Monkey.java
2009-12-14 16:23:32 -08:00
Dan Egnor
d0225ee63f Remove the old Dev Tools exception browser (since it relies on
now eliminated checkin database crash storage functionality).

Add a new test app to Dev Tools, "Bad Behavior", which has
buttons to crash and generate an ANR on command.

Update the Monkey to follow changed APIs.
2009-12-11 13:26:46 -08:00
Ying Wang
a35897da6f Package blacklist/whitelist file support for Monkey.
With this CL, you can specify a package whitelist file or a package blacklist file,
but not both. You can not specify both individual packages via -p and blacklist file,
either. But you can specify both whitelist file and individual packages via -p and they
will be summed up.
2009-12-10 10:55:50 -08:00
Eric Rowe
80de953874 Fix bug where monkey always tries to run multiple scripts.
Change condition so MonkeySourceRandromScript is only triggered on multiple
scripts.
2009-11-03 18:28:51 -08:00
Eric Rowe
20a74d7966 Create way to run monkey with multiple scripts.
By giving multiple -f arguments, the monkey will randomly choose between the
scripts.  Also, add the --setup argument which will run a setup script before
starting to play the other scripts in random order.
2009-10-28 15:36:34 -07:00
Eric Rowe
65440eb58d Fix how the monkey counts events for scripts.
Instead of the monkey counting up to the count times the number of events in the
script, the monkey will now only increment the count when the script reaches the
end of the file.  This allows us to have multiple script files with differing
event counts in each.
2009-10-22 14:13:27 -07:00
Eric Rowe
20e7a15bb7 Modify Monkey so that scripts can use raw and user events.
Fix javadoc comment in MonkeySourceRandom.java and combine raw events and user
events in MonkeySourceScript.java.  Also, fix bug where too few arguments in
the script causes a RuntimeException.
2009-10-20 10:38:56 -07:00