Esempio n. 1
0
 def _set_defaults(self):
     self.service = Bag(
         base='system-image.ubports.com',
         http_port=80,
         https_port=443,
         channel='daily',
         build_number=0,
     )
     self.system = Bag(
         timeout=as_timedelta('1h'),
         tempdir='/tmp',
         logfile='/var/log/system-image/client.log',
         loglevel=as_loglevel('info'),
         settings_db='/var/lib/system-image/settings.db',
     )
     self.gpg = Bag(
         archive_master='/usr/share/system-image/archive-master.tar.xz',
         image_master='/var/lib/system-image/keyrings/image-master.tar.xz',
         image_signing='/var/lib/system-image/keyrings/image-signing.tar.xz',
         device_signing=
         '/var/lib/system-image/keyrings/device-signing.tar.xz',
     )
     self.updater = Bag(
         cache_partition='/android/cache/recovery',
         data_partition='/var/lib/system-image',
     )
     self.hooks = Bag(
         device=as_object('systemimage.device.SystemProperty'),
         scorer=as_object('systemimage.scores.WeightedScorer'),
         apply=as_object('systemimage.apply.Reboot'),
     )
     self.dbus = Bag(lifetime=as_timedelta('10m'), )
Esempio n. 2
0
 def test_as_loglevel_uppercase(self):
     self.assertEqual(as_loglevel('CRITICAL'),
                      (logging.CRITICAL, logging.ERROR))
Esempio n. 3
0
 def test_as_loglevel(self):
     # The default D-Bus log level is ERROR.
     self.assertEqual(as_loglevel('critical'),
                      (logging.CRITICAL, logging.ERROR))
Esempio n. 4
0
 def test_as_dbus_loglevel(self):
     self.assertEqual(as_loglevel('error:info'),
                      (logging.ERROR, logging.INFO))