FAFT: Removal of firmware_Fastboot* files
Part of the on-going effort to remove Ryu/Android support.
BUG=b:138222680
TEST=workstation
Change-Id: Id1cd0246736a3fb0ef1adc4ae3c882957f1e9e6d
Reviewed-on: https://chromium-review.googlesource.com/1749603
Tested-by: Oleg Loskutoff <olegmikhail@google.com>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
diff --git a/server/site_tests/firmware_FastbootErase/control b/server/site_tests/firmware_FastbootErase/control
deleted file mode 100644
index 92ee308..0000000
--- a/server/site_tests/firmware_FastbootErase/control
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.server import utils
-
-AUTHOR = "Chrome OS Team"
-NAME = "firmware_FastbootErase"
-PURPOSE = "Android Fastboot test for verifying erase function"
-CRITERIA = "This test will erase the kernel and try to boot up"
-ATTRIBUTES = "suite:faft_normal_ryu"
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "firmware"
-TEST_TYPE = "server"
-
-DOC = """
-This test tests erasing kernel partition in DUT through fastboot
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-def run_FastbootErase(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test("firmware_FastbootErase", host=host, cmdline_args=args,
- disable_sysinfo=True, dev_mode=False, tag="normal")
-
-parallel_simple(run_FastbootErase, machines)
diff --git a/server/site_tests/firmware_FastbootErase/control.dev b/server/site_tests/firmware_FastbootErase/control.dev
deleted file mode 100644
index 23d4be9..0000000
--- a/server/site_tests/firmware_FastbootErase/control.dev
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.server import utils
-
-AUTHOR = "Chrome OS Team"
-NAME = "firmware_FastbootErase.dev"
-PURPOSE = "Android Fastboot test for verifying erase function"
-CRITERIA = "This test will erase the kernel and try to boot up"
-ATTRIBUTES = "suite:faft_dev_ryu"
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "firmware"
-TEST_TYPE = "server"
-
-DOC = """
-This test tests erasing kernel partition in DUT through fastboot
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-def run_FastbootErase(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test("firmware_FastbootErase", host=host, cmdline_args=args,
- disable_sysinfo=True, dev_mode=True, tag="dev")
-
-parallel_simple(run_FastbootErase, machines)
diff --git a/server/site_tests/firmware_FastbootErase/firmware_FastbootErase.py b/server/site_tests/firmware_FastbootErase/firmware_FastbootErase.py
deleted file mode 100644
index 160b26e..0000000
--- a/server/site_tests/firmware_FastbootErase/firmware_FastbootErase.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-
-from autotest_lib.client.bin import utils
-from autotest_lib.client.common_lib import error
-from autotest_lib.server.cros import vboot_constants as vboot
-from autotest_lib.server.cros.faft.firmware_test import FirmwareTest
-
-
-class firmware_FastbootErase(FirmwareTest):
- """
- Testing Erase functionality in Fastboot
- Will erase the kernel, causing the DUT to
- boot into recovery mode. Then restores the
- kernel.
-
- This needs to be only enabled for Android tests.
- """
- version = 1
-
- KERNEL_TMP_FILE = '/tmp/android_kernel'
-
- def initialize(self, host, cmdline_args, dev_mode=False):
- super(firmware_FastbootErase, self).initialize(host, cmdline_args)
- self.switcher.setup_mode('dev' if dev_mode else 'normal')
- # set flags so that we can do the erase command
- self.clear_set_gbb_flags(0,
- vboot.GBB_FLAG_FORCE_DEV_BOOT_FASTBOOT_FULL_CAP)
-
- def cleanup(self):
- """Restore the gbb flags"""
- self.clear_set_gbb_flags(vboot.GBB_FLAG_FORCE_DEV_BOOT_FASTBOOT_FULL_CAP,
- 0)
- super(firmware_FastbootErase, self).cleanup()
-
- def is_recovery_mode(self):
- """Check if DUT in recovery mode
-
- Unfortunately, adb get-state just returns "unknown"
- so need to do it with adb devices and regexp
- """
- result = self.faft_client.Host.RunShellCommandGetOutput(
- 'adb devices')
- if 'recovery' in result[1]:
- return True
- else:
- return False
-
- def wait_for_client_recovery(self, timeout=300):
- """Blocks until detects that DUT is in recovery mode"""
- utils.wait_for_value(self.is_recovery_mode, True, timeout_sec=timeout)
-
- def run_once(self, dev_mode=False):
- """Runs a single iteration of the test."""
- if not self.faft_client.System.HasHost():
- raise error.TestNAError('DUT is not Android device. Skipping test')
-
- # first copy out kernel partition
- logging.info("Making copy of kernel")
- self.faft_client.Host.RunShellCommand(
- 'adb pull /dev/block/mmcblk0p1 %s' % self.KERNEL_TMP_FILE)
-
- # now erase boot partition
- self.faft_client.Host.RunShellCommand('adb reboot bootloader')
- self.switcher.wait_for_client_fastboot()
-
- if not self.switcher.is_fastboot_mode():
- raise error.TestFail("DUT not in fastboot mode!")
-
- logging.info("Erasing the kernel")
- self.faft_client.Host.RunShellCommand('fastboot erase kernel')
- self.faft_client.Host.RunShellCommand('fastboot continue')
-
- # DUT should enter into recovery OS
- self.wait_for_client_recovery()
-
- # Push the volume down button to "Reboot to bootloader"
- # and select it with the power button
- self.servo.volume_down()
- self.servo.power_key(self.faft_config.hold_pwr_button_poweron)
- self.switcher.wait_for_client_fastboot()
-
- # Should be in recovery mode.
- # Reflash the kernel image that we saved earlier
- logging.info("Repairing the kernel")
- self.faft_client.Host.RunShellCommand(
- 'fastboot flash kernel %s' % self.KERNEL_TMP_FILE)
- self.faft_client.Host.RunShellCommand(
- 'fastboot continue')
-
- self.switcher.wait_for_client()
-
- # cleaning up the temp file
- self.faft_client.Host.RunShellCommand(
- 'rm %s' % self.KERNEL_TMP_FILE)
diff --git a/server/site_tests/firmware_FastbootReboot/control b/server/site_tests/firmware_FastbootReboot/control
deleted file mode 100644
index a81b299..0000000
--- a/server/site_tests/firmware_FastbootReboot/control
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.server import utils
-
-AUTHOR = "Chrome OS Team"
-NAME = "firmware_FastbootReboot"
-PURPOSE = "firmware boot test using Android Fastboot"
-CRITERIA = "This test will fail if the DUT does not reboot into expected states"
-ATTRIBUTES = "suite:faft_normal_ryu"
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "firmware"
-TEST_TYPE = "server"
-
-DOC = """
-This test tests rebooting of the DUT while in fastboot
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-def run_FastbootReboot(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test("firmware_FastbootReboot", host=host, cmdline_args=args,
- disable_sysinfo=True, dev_mode=False, tag="normal")
-
-parallel_simple(run_FastbootReboot, machines)
diff --git a/server/site_tests/firmware_FastbootReboot/control.dev b/server/site_tests/firmware_FastbootReboot/control.dev
deleted file mode 100644
index 266b65e..0000000
--- a/server/site_tests/firmware_FastbootReboot/control.dev
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from autotest_lib.server import utils
-
-AUTHOR = "Chrome OS Team"
-NAME = "firmware_FastbootReboot.dev"
-PURPOSE = "firmware boot test using Android Fastboot"
-CRITERIA = "This test will fail if the DUT does not reboot into expected states"
-ATTRIBUTES = "suite:faft_dev_ryu"
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "firmware"
-TEST_TYPE = "server"
-
-DOC = """
-This test tests rebooting of the DUT while in fastboot
-"""
-
-args_dict = utils.args_to_dict(args)
-servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
-
-def run_FastbootReboot(machine):
- host = hosts.create_host(machine, servo_args=servo_args)
- job.run_test("firmware_FastbootReboot", host=host, cmdline_args=args,
- disable_sysinfo=True, dev_mode=True, tag="dev")
-
-parallel_simple(run_FastbootReboot, machines)
diff --git a/server/site_tests/firmware_FastbootReboot/firmware_FastbootReboot.py b/server/site_tests/firmware_FastbootReboot/firmware_FastbootReboot.py
deleted file mode 100644
index 599aed0..0000000
--- a/server/site_tests/firmware_FastbootReboot/firmware_FastbootReboot.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import logging
-
-from autotest_lib.client.common_lib import error
-from autotest_lib.server.cros.faft.firmware_test import FirmwareTest
-
-
-class firmware_FastbootReboot(FirmwareTest):
- """
- Reboot testing through Fastboot.
- Testing:
- fastboot reboot
- fastboot reboot-bootloader
-
- This needs to be only enabled for Android tests.
- """
- version = 1
-
- def initialize(self, host, cmdline_args, dev_mode=False):
- super(firmware_FastbootReboot, self).initialize(host, cmdline_args)
- self.switcher.setup_mode('dev' if dev_mode else 'normal')
-
- def in_fastboot_mode(self):
- """Makes sure that we're in fastboot mode."""
- result = self.faft_client.Host.RunShellCommandGetOutput(
- 'fastboot devices')
- if not result:
- return False
- else:
- return True
-
- def run_once(self, dev_mode=False):
- """Runs a single iteration of the test."""
- if not self.faft_client.System.HasHost():
- raise error.TestNAError('DUT is not Android device. Skipping test')
-
- self.faft_client.Host.RunShellCommand('adb reboot bootloader')
- # make sure that DUT goes offline first
- self.switcher.wait_for_client_offline()
- self.switcher.wait_for_client_fastboot()
-
- if not self.in_fastboot_mode():
- raise error.TestFail("DUT not in fastboot mode!")
-
- # try rebooting into OS
- logging.info("Testing fastboot reboot")
- self.faft_client.Host.RunShellCommand('fastboot reboot')
- # make sure that DUT goes offline first
- self.switcher.wait_for_client_offline()
- self.switcher.wait_for_client()
-
- # now reboot into fastboot again
- self.faft_client.Host.RunShellCommand('adb reboot bootloader')
- # make sure that DUT goes offline first
- self.switcher.wait_for_client_offline()
- self.switcher.wait_for_client_fastboot()
- if not self.in_fastboot_mode():
- raise error.TestFail("DUT not in fastboot mode!")
-
- logging.info("Testing fastboot reboot-bootloader")
- self.faft_client.Host.RunShellCommand('fastboot reboot-bootloader')
- # make sure that DUT goes offline first
- self.switcher.wait_for_client_offline()
- self.switcher.wait_for_client_fastboot()
- if not self.in_fastboot_mode():
- raise error.TestFail("DUT not in fastboot mode!")
-
- self.faft_client.Host.RunShellCommand('fastboot continue')
- self.switcher.wait_for_client()