Lines Matching refs:self

31     def getFstab(self):  argument
32 self.dut.adb.root()
35 extension = self.dut.adb.shell("getprop ro.boot." + prop, no_except = True)
41 contents = self.dut.adb.shell("cat " + filename + extension, no_except = True)
49 def isCheckpoint(self): argument
50 fstab = self.getFstab().splitlines()
64 def setUpClass(self): argument
65 self.dut = self.android_devices[0]
66 self.shell = self.dut.shell
67 self.isCheckpoint_ = self.isCheckpoint()
69 def reboot(self): argument
70 self.dut.adb.reboot()
72 self.dut.adb.wait_for_device(timeout=900)
73 except self.dut.adb.AdbError as e:
80 self.dut.adb.root()
87 self.dut.adb.shell("ls");
92 def checkBooted(self): argument
94 result = self.dut.adb.shell("getprop sys.boot_completed")
104 def testCheckpointEnabled(self): argument
105 result = self.dut.adb.shell("getprop ro.product.first_api_level")
108 asserts.assertTrue(first_api_level < 29 or self.isCheckpoint_,
113 def testRollback(self): argument
114 if not self.isCheckpoint_:
117 self.dut.adb.root()
121 self.checkBooted()
124 self.dut.adb.shell("setprop persist.vold.dont_commit_checkpoint 1")
125 self.dut.adb.shell("echo " + self._ORIGINALVALUE + " > " + self._CHECKPOINTTESTFILE)
126 result = self.dut.adb.shell("vdc checkpoint startCheckpoint 1", no_except = True)
128 self.reboot()
131 self.dut.adb.shell("echo " + self._MODIFIEDVALUE + " > " + self._CHECKPOINTTESTFILE)
132 self.reboot()
135 result = self.dut.adb.shell("cat " + self._CHECKPOINTTESTFILE)
136 asserts.assertEqual(result.strip(), self._ORIGINALVALUE)
139 self.dut.adb.shell("setprop persist.vold.dont_commit_checkpoint 0")
140 result = self.dut.adb.shell("vdc checkpoint commitChanges", no_except = True)
142 self.reboot()
143 self.dut.adb.shell("rm " + self._CHECKPOINTTESTFILE)
145 def testCommit(self): argument
146 if not self.isCheckpoint_:
149 self.dut.adb.root()
153 self.checkBooted()
156 self.dut.adb.shell("setprop persist.vold.dont_commit_checkpoint 1")
157 self.dut.adb.shell("echo " + self._ORIGINALVALUE + " > " + self._CHECKPOINTTESTFILE)
158 result = self.dut.adb.shell("vdc checkpoint startCheckpoint 1", no_except = True)
160 self.reboot()
163 self.dut.adb.shell("echo " + self._MODIFIEDVALUE + " > " + self._CHECKPOINTTESTFILE)
164 self.dut.adb.shell("setprop persist.vold.dont_commit_checkpoint 0")
165 result = self.dut.adb.shell("vdc checkpoint commitChanges", no_except = True)
167 self.reboot()
170 result = self.dut.adb.shell("cat " + self._CHECKPOINTTESTFILE)
171 asserts.assertEqual(result.strip(), self._MODIFIEDVALUE)
174 self.dut.adb.shell("rm " + self._CHECKPOINTTESTFILE)