def testGetAudioFiles(self):
    config = CrosConfig(self.filepath)
    audio_files = config.GetAudioFiles()
    expected = \
      [BaseFile(source='cras-config/another/dsp.ini',
                dest='/etc/cras/another/dsp.ini'),
       BaseFile(source='cras-config/another/a-card',
                dest='/etc/cras/another/a-card'),
       BaseFile(source='cras-config/some/dsp.ini',
                dest='/etc/cras/some/dsp.ini'),
       BaseFile(source='cras-config/some/a-card',
                dest='/etc/cras/some/a-card'),
       BaseFile(source='topology/another-tplg.bin',
                dest='/lib/firmware/another-tplg.bin'),
       BaseFile(source='topology/some-tplg.bin',
                dest='/lib/firmware/some-tplg.bin'),
       BaseFile(source='ucm-config/a-card.another/HiFi.conf',
                dest='/usr/share/alsa/ucm/a-card.another/HiFi.conf'),
       BaseFile(source='ucm-config/a-card.another/a-card.another.conf',
                dest='/usr/share/alsa/ucm/a-card.another/a-card.another.conf'),
       BaseFile(source='ucm-config/a-card.some/HiFi.conf',
                dest='/usr/share/alsa/ucm/a-card.some/HiFi.conf'),
       BaseFile(source='ucm-config/a-card.some/a-card.some.conf',
                dest='/usr/share/alsa/ucm/a-card.some/a-card.some.conf')]

    self.assertEqual(audio_files, sorted(expected))
 def testGetThermalFiles(self):
   config = CrosConfig(self.filepath)
   thermal_files = config.GetThermalFiles()
   self.assertEqual(
       thermal_files,
       [BaseFile('another/dptf.dv', '/etc/dptf/another/dptf.dv'),
        BaseFile('some_notouch/dptf.dv', '/etc/dptf/some_notouch/dptf.dv'),
        BaseFile('some_touch/dptf.dv', '/etc/dptf/some_touch/dptf.dv')])
Esempio n. 3
0
 def _GetFiles(self, path):
   result = []
   file_region = self.GetProperties(path)
   if file_region and 'files' in file_region:
     for item in file_region['files']:
       if 'build-path' in item:
         result.append(BaseFile(item['build-path'], item['system-path']))
       else:
         result.append(BaseFile(item['source'], item['destination']))
   return result
 def testGetArcFiles(self):
   config = CrosConfig(self.filepath)
   arc_files = config.GetArcFiles()
   self.assertEqual(arc_files, [
       BaseFile(
           source='some/hardware_features.xml',
           dest='/etc/some_hardware_features.xml'),
       BaseFile(
           source='some/media_profiles.xml',
           dest='/etc/some_media_profiles.xml'),
   ])
Esempio n. 5
0
 def testGetBluetoothFiles(self):
     config = CrosConfig(self.filepath)
     bluetooth_files = config.GetBluetoothFiles()
     self.assertEqual(bluetooth_files, [
         BaseFile(source='some/main.conf',
                  dest='/etc/bluetooth/some/main.conf')
     ])
Esempio n. 6
0
 def GetBluetoothFiles(self):
     result = []
     config = self.GetProperties('/bluetooth/config')
     if config:
         result.append(BaseFile(config['build-path'],
                                config['system-path']))
     return result
 def testGetArcFiles(self):
   config = CrosConfig(self.filepath)
   arc_files = config.GetArcFiles()
   self.assertEqual(
       arc_files,
       [BaseFile(
           source='some/hardware_features',
           dest='/usr/share/chromeos-config/sbin/some/hardware_features')])
Esempio n. 8
0
 def _GetSystemFilesV2(self, paths):
     result = []
     for path in paths:
         config = self.GetProperties(path)
         if config:
             result.append(
                 BaseFile(config['build-path'], config['system-path']))
     return result