(value)
| 1130 | |
| 1131 | @staticmethod |
| 1132 | def SetCPUGovernor(value): |
| 1133 | try: |
| 1134 | cpu_indices = CustomMachineConfiguration.GetCPUCoresRange() |
| 1135 | for cpu_index in cpu_indices: |
| 1136 | cpu_device = CustomMachineConfiguration.GetCPUPathForId(cpu_index) |
| 1137 | with open(cpu_device, 'w') as f: |
| 1138 | f.write(value) |
| 1139 | |
| 1140 | except Exception: |
| 1141 | logging.exception('Failed to change CPU governor to %s. Are we ' |
| 1142 | 'running under sudo?', value) |
| 1143 | raise |
| 1144 | |
| 1145 | cur_value = CustomMachineConfiguration.GetCPUGovernor() |
| 1146 | if cur_value != value: |
| 1147 | raise Exception('Could not set CPU governor. Present value is %s' |
| 1148 | % cur_value ) |
| 1149 | |
| 1150 | |
| 1151 | class MaxTotalDurationReachedError(Exception): |
no test coverage detected