Revert "[recipes] Fix Android failures after Python3 update"
This reverts commit 3b1a71caba
.
Reason for revert: missing CIPD package on armv6l
Original change's description:
> [recipes] Fix Android failures after Python3 update
>
> Change-Id: I968462c5dd2139b3ff11d8d25efbd5baa3351cba
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472696
> Reviewed-by: Ravi Mistry <rmistry@google.com>
> Commit-Queue: Eric Boren <borenet@google.com>
Change-Id: Ic8143e0c98f8dac196a49ac3af12bad836370662
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472657
Auto-Submit: Eric Boren <borenet@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This commit is contained in:
parent
b2271e6016
commit
04cd6fba97
@ -333,11 +333,11 @@ print('Setting frequency to %d' % freq)
|
||||
# We must set min first, because if we try to set max to be less than min
|
||||
# (which sometimes happens after certain devices reboot) it returns a
|
||||
# perplexing permissions error.
|
||||
subprocess.check_call([ADB, 'shell', 'echo 0 > '
|
||||
subprocess.check_([ADB, 'shell', 'echo 0 > '
|
||||
'%s/scaling_min_freq' % root])
|
||||
subprocess.check_call([ADB, 'shell', 'echo %d > '
|
||||
subprocess.check_([ADB, 'shell', 'echo %d > '
|
||||
'%s/scaling_max_freq' % (freq, root)])
|
||||
subprocess.check_call([ADB, 'shell', 'echo %d > '
|
||||
subprocess.check_([ADB, 'shell', 'echo %d > '
|
||||
'%s/scaling_setspeed' % (freq, root)])
|
||||
time.sleep(5)
|
||||
actual_freq = subprocess.check_output([ADB, 'shell', 'cat '
|
||||
@ -381,7 +381,7 @@ def wait_for_device():
|
||||
while True:
|
||||
time.sleep(5)
|
||||
print('Waiting for device')
|
||||
subprocess.check_call([ADB, 'wait-for-device'])
|
||||
subprocess.check_([ADB, 'wait-for-device'])
|
||||
bit1 = subprocess.check_output([ADB, 'shell', 'getprop',
|
||||
'dev.bootcomplete']).decode('utf-8')
|
||||
bit2 = subprocess.check_output([ADB, 'shell', 'getprop',
|
||||
|
@ -245,7 +245,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -300,11 +300,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -245,7 +245,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -300,11 +300,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -200,7 +200,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nASAN_SETUP = sys.argv[2]\n\ndef wait_for_device():\n while True:\n time.sleep(5)\n print('Waiting for device')\n subprocess.check_call([ADB, 'wait-for-device'])\n bit1 = subprocess.check_output([ADB, 'shell', 'getprop',\n 'dev.bootcomplete']).decode('utf-8')\n bit2 = subprocess.check_output([ADB, 'shell', 'getprop',\n 'sys.boot_completed']).decode('utf-8')\n if '1' in bit1 and '1' in bit2:\n print('Device detected')\n break\n\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\noutput = subprocess.check_output([ADB, 'disable-verity']).decode('utf-8')\nprint(output)\n\nif 'already disabled' not in output:\n print('Rebooting device')\n subprocess.check_call([ADB, 'reboot'])\n wait_for_device()\n\ndef installASAN(revert=False):\n # ASAN setup script is idempotent, either it installs it or\n # says it's installed. Returns True on success, false otherwise.\n out = subprocess.check_output([ADB, 'wait-for-device']).decode('utf-8')\n print(out)\n cmd = [ASAN_SETUP]\n if revert:\n cmd = [ASAN_SETUP, '--revert']\n process = subprocess.Popen(cmd, env={'ADB': ADB},\n stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n\n # this also blocks until command finishes\n (stdout, stderr) = process.communicate()\n print(stdout.decode('utf-8'))\n print('Stderr: %s' % stderr.decode('utf-8'))\n return process.returncode == 0\n\nif not installASAN():\n print('Trying to revert the ASAN install and then re-install')\n # ASAN script sometimes has issues if it was interrupted or partially applied\n # Try reverting it, then re-enabling it\n if not installASAN(revert=True):\n raise Exception('reverting ASAN install failed')\n\n # Sleep because device does not reboot instantly\n time.sleep(10)\n\n if not installASAN():\n raise Exception('Tried twice to setup ASAN and failed.')\n\n# Sleep because device does not reboot instantly\ntime.sleep(10)\nwait_for_device()\n# Sleep again to hopefully avoid error \"secure_mkdirs failed: No such file or\n# directory\" when pushing resources to the device.\ntime.sleep(60)\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nASAN_SETUP = sys.argv[2]\n\ndef wait_for_device():\n while True:\n time.sleep(5)\n print('Waiting for device')\n subprocess.check_([ADB, 'wait-for-device'])\n bit1 = subprocess.check_output([ADB, 'shell', 'getprop',\n 'dev.bootcomplete']).decode('utf-8')\n bit2 = subprocess.check_output([ADB, 'shell', 'getprop',\n 'sys.boot_completed']).decode('utf-8')\n if '1' in bit1 and '1' in bit2:\n print('Device detected')\n break\n\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\noutput = subprocess.check_output([ADB, 'disable-verity']).decode('utf-8')\nprint(output)\n\nif 'already disabled' not in output:\n print('Rebooting device')\n subprocess.check_call([ADB, 'reboot'])\n wait_for_device()\n\ndef installASAN(revert=False):\n # ASAN setup script is idempotent, either it installs it or\n # says it's installed. Returns True on success, false otherwise.\n out = subprocess.check_output([ADB, 'wait-for-device']).decode('utf-8')\n print(out)\n cmd = [ASAN_SETUP]\n if revert:\n cmd = [ASAN_SETUP, '--revert']\n process = subprocess.Popen(cmd, env={'ADB': ADB},\n stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n\n # this also blocks until command finishes\n (stdout, stderr) = process.communicate()\n print(stdout.decode('utf-8'))\n print('Stderr: %s' % stderr.decode('utf-8'))\n return process.returncode == 0\n\nif not installASAN():\n print('Trying to revert the ASAN install and then re-install')\n # ASAN script sometimes has issues if it was interrupted or partially applied\n # Try reverting it, then re-enabling it\n if not installASAN(revert=True):\n raise Exception('reverting ASAN install failed')\n\n # Sleep because device does not reboot instantly\n time.sleep(10)\n\n if not installASAN():\n raise Exception('Tried twice to setup ASAN and failed.')\n\n# Sleep because device does not reboot instantly\ntime.sleep(10)\nwait_for_device()\n# Sleep again to hopefully avoid error \"secure_mkdirs failed: No such file or\n# directory\" when pushing resources to the device.\ntime.sleep(60)\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"[START_DIR]/android_ndk_linux/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/bin/asan_device_setup"
|
||||
],
|
||||
@ -224,7 +224,7 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@ while True:@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ print('Waiting for device')@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ subprocess.check_call([ADB, 'wait-for-device'])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ subprocess.check_([ADB, 'wait-for-device'])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ bit1 = subprocess.check_output([ADB, 'shell', 'getprop',@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ 'dev.bootcomplete']).decode('utf-8')@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ bit2 = subprocess.check_output([ADB, 'shell', 'getprop',@@@",
|
||||
|
@ -245,7 +245,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/usr/bin/adb.1.0.35",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -300,11 +300,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
@ -320,7 +320,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/usr/bin/adb.1.0.35",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -375,11 +375,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
@ -395,7 +395,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/usr/bin/adb.1.0.35",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -450,11 +450,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -245,7 +245,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -300,11 +300,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
@ -320,7 +320,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -375,11 +375,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
@ -395,7 +395,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -450,11 +450,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -245,7 +245,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -300,11 +300,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
@ -320,7 +320,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -375,11 +375,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -245,7 +245,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -300,11 +300,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -245,7 +245,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -300,11 +300,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -295,7 +295,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/opt/infra-android/tools/adb",
|
||||
"0.6",
|
||||
"4"
|
||||
@ -350,11 +350,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -93,7 +93,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_call([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_call([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\ntarget_percent = float(sys.argv[2])\ncpu = int(sys.argv[3])\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\nroot = '/sys/devices/system/cpu/cpu%d/cpufreq' %cpu\n\n# All devices we test on give a list of their available frequencies.\navailable_freqs = subprocess.check_output([ADB, 'shell',\n 'cat %s/scaling_available_frequencies' % root]).decode('utf-8')\n\n# Check for message like '/system/bin/sh: file not found'\nif available_freqs and '/system/bin/sh' not in available_freqs:\n available_freqs = sorted(\n int(i) for i in available_freqs.strip().split())\nelse:\n raise Exception('Could not get list of available frequencies: %s' %\n available_freqs)\n\nmaxfreq = available_freqs[-1]\ntarget = int(round(maxfreq * target_percent))\nfreq = maxfreq\nfor f in reversed(available_freqs):\n if f <= target:\n freq = f\n break\n\nprint('Setting frequency to %d' % freq)\n\n# If scaling_max_freq is lower than our attempted setting, it won't take.\n# We must set min first, because if we try to set max to be less than min\n# (which sometimes happens after certain devices reboot) it returns a\n# perplexing permissions error.\nsubprocess.check_([ADB, 'shell', 'echo 0 > '\n '%s/scaling_min_freq' % root])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_max_freq' % (freq, root)])\nsubprocess.check_([ADB, 'shell', 'echo %d > '\n '%s/scaling_setspeed' % (freq, root)])\ntime.sleep(5)\nactual_freq = subprocess.check_output([ADB, 'shell', 'cat '\n '%s/scaling_cur_freq' % root]).decode('utf-8').strip()\nif actual_freq != str(freq):\n raise Exception('(actual, expected) (%s, %d)'\n % (actual_freq, freq))\n",
|
||||
"/usr/bin/adb.1.0.35",
|
||||
"0.6",
|
||||
"0"
|
||||
@ -148,11 +148,11 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@# We must set min first, because if we try to set max to be less than min@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# (which sometimes happens after certain devices reboot) it returns a@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@# perplexing permissions error.@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo 0 > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_min_freq' % root])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_max_freq' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@subprocess.check_([ADB, 'shell', 'echo %d > '@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ '%s/scaling_setspeed' % (freq, root)])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@actual_freq = subprocess.check_output([ADB, 'shell', 'cat '@@@",
|
||||
|
@ -48,7 +48,7 @@
|
||||
"cmd": [
|
||||
"python",
|
||||
"-u",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nASAN_SETUP = sys.argv[2]\n\ndef wait_for_device():\n while True:\n time.sleep(5)\n print('Waiting for device')\n subprocess.check_call([ADB, 'wait-for-device'])\n bit1 = subprocess.check_output([ADB, 'shell', 'getprop',\n 'dev.bootcomplete']).decode('utf-8')\n bit2 = subprocess.check_output([ADB, 'shell', 'getprop',\n 'sys.boot_completed']).decode('utf-8')\n if '1' in bit1 and '1' in bit2:\n print('Device detected')\n break\n\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\noutput = subprocess.check_output([ADB, 'disable-verity']).decode('utf-8')\nprint(output)\n\nif 'already disabled' not in output:\n print('Rebooting device')\n subprocess.check_call([ADB, 'reboot'])\n wait_for_device()\n\ndef installASAN(revert=False):\n # ASAN setup script is idempotent, either it installs it or\n # says it's installed. Returns True on success, false otherwise.\n out = subprocess.check_output([ADB, 'wait-for-device']).decode('utf-8')\n print(out)\n cmd = [ASAN_SETUP]\n if revert:\n cmd = [ASAN_SETUP, '--revert']\n process = subprocess.Popen(cmd, env={'ADB': ADB},\n stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n\n # this also blocks until command finishes\n (stdout, stderr) = process.communicate()\n print(stdout.decode('utf-8'))\n print('Stderr: %s' % stderr.decode('utf-8'))\n return process.returncode == 0\n\nif not installASAN():\n print('Trying to revert the ASAN install and then re-install')\n # ASAN script sometimes has issues if it was interrupted or partially applied\n # Try reverting it, then re-enabling it\n if not installASAN(revert=True):\n raise Exception('reverting ASAN install failed')\n\n # Sleep because device does not reboot instantly\n time.sleep(10)\n\n if not installASAN():\n raise Exception('Tried twice to setup ASAN and failed.')\n\n# Sleep because device does not reboot instantly\ntime.sleep(10)\nwait_for_device()\n# Sleep again to hopefully avoid error \"secure_mkdirs failed: No such file or\n# directory\" when pushing resources to the device.\ntime.sleep(60)\n",
|
||||
"\nimport os\nimport subprocess\nimport sys\nimport time\nADB = sys.argv[1]\nASAN_SETUP = sys.argv[2]\n\ndef wait_for_device():\n while True:\n time.sleep(5)\n print('Waiting for device')\n subprocess.check_([ADB, 'wait-for-device'])\n bit1 = subprocess.check_output([ADB, 'shell', 'getprop',\n 'dev.bootcomplete']).decode('utf-8')\n bit2 = subprocess.check_output([ADB, 'shell', 'getprop',\n 'sys.boot_completed']).decode('utf-8')\n if '1' in bit1 and '1' in bit2:\n print('Device detected')\n break\n\nlog = subprocess.check_output([ADB, 'root']).decode('utf-8')\n# check for message like 'adbd cannot run as root in production builds'\nprint(log)\nif 'cannot' in log:\n raise Exception('adb root failed')\n\noutput = subprocess.check_output([ADB, 'disable-verity']).decode('utf-8')\nprint(output)\n\nif 'already disabled' not in output:\n print('Rebooting device')\n subprocess.check_call([ADB, 'reboot'])\n wait_for_device()\n\ndef installASAN(revert=False):\n # ASAN setup script is idempotent, either it installs it or\n # says it's installed. Returns True on success, false otherwise.\n out = subprocess.check_output([ADB, 'wait-for-device']).decode('utf-8')\n print(out)\n cmd = [ASAN_SETUP]\n if revert:\n cmd = [ASAN_SETUP, '--revert']\n process = subprocess.Popen(cmd, env={'ADB': ADB},\n stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n\n # this also blocks until command finishes\n (stdout, stderr) = process.communicate()\n print(stdout.decode('utf-8'))\n print('Stderr: %s' % stderr.decode('utf-8'))\n return process.returncode == 0\n\nif not installASAN():\n print('Trying to revert the ASAN install and then re-install')\n # ASAN script sometimes has issues if it was interrupted or partially applied\n # Try reverting it, then re-enabling it\n if not installASAN(revert=True):\n raise Exception('reverting ASAN install failed')\n\n # Sleep because device does not reboot instantly\n time.sleep(10)\n\n if not installASAN():\n raise Exception('Tried twice to setup ASAN and failed.')\n\n# Sleep because device does not reboot instantly\ntime.sleep(10)\nwait_for_device()\n# Sleep again to hopefully avoid error \"secure_mkdirs failed: No such file or\n# directory\" when pushing resources to the device.\ntime.sleep(60)\n",
|
||||
"/usr/bin/adb.1.0.35",
|
||||
"[START_DIR]/android_ndk_linux/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.8/bin/asan_device_setup"
|
||||
],
|
||||
@ -72,7 +72,7 @@
|
||||
"@@@STEP_LOG_LINE@python.inline@ while True:@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ time.sleep(5)@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ print('Waiting for device')@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ subprocess.check_call([ADB, 'wait-for-device'])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ subprocess.check_([ADB, 'wait-for-device'])@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ bit1 = subprocess.check_output([ADB, 'shell', 'getprop',@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ 'dev.bootcomplete']).decode('utf-8')@@@",
|
||||
"@@@STEP_LOG_LINE@python.inline@ bit2 = subprocess.check_output([ADB, 'shell', 'getprop',@@@",
|
||||
|
Loading…
Reference in New Issue
Block a user