~psusi/ubuntu/utopic/udisks2/fix-standby

« back to all changes in this revision

Viewing changes to src/tests/integration-test

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-22 15:27:56 UTC
  • mfrom: (14.1.5 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130522152756-r7wn9l9wilgycocp
Tags: 2.1.0-3git1
Upload current Debian packaging git head to fix autopkgtest.

* Add 00git_nonexisting_run_udev_rules.d.patch: integration-test: Fix for
  nonexisting /run/udev/rules.d/.
* Add 00git_vfat_test_case_insensitivity.patch: integration-test: For VFAT,
  ignore case for label comparison.

Show diffs side-by-side

added added

removed removed

Lines of Context:
402
402
        # work around scsi_debug not implementing CD-ROM SCSI commands, so that
403
403
        # udev's cdrom_id does not recognize tracks
404
404
        scsi_debug_rules = '/run/udev/rules.d/60-persistent-storage-scsi_debug.rules'
405
 
        if os.path.isdir('/run/udev/rules.d') and not os.path.exists(scsi_debug_rules):
 
405
        if os.path.isdir('/run/udev') and not os.path.exists(scsi_debug_rules):
 
406
            os.makedirs('/run/udev/rules.d', exist_ok=True)
406
407
            with open(scsi_debug_rules, 'w') as f:
407
408
                f.write('''KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ATTRS{model}=="scsi_debug*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
408
409
''')
846
847
        self.assertEqual(block.get_property('id-usage'), (type == 'swap') and 'other' or 'filesystem')
847
848
 
848
849
        self.assertEqual(block.get_property('id-type'), type)
849
 
        self.assertEqual(block.get_property('id-label'), label or '')
 
850
        l = block.get_property('id-label')
 
851
        if type == 'vfat':
 
852
            l = l.lower()  # VFAT is case insensitive
 
853
        self.assertEqual(l, label or '')
850
854
        self.assertEqual(block.get_property('hint-name'), '')
851
855
        if type != 'minix':
852
856
            self.assertEqual(block.get_property('id-uuid'), self.blkid()['ID_FS_UUID'])
902
906
        id = self.blkid()
903
907
        self.assertEqual(id['ID_FS_USAGE'], type == 'swap' and 'other' or 'filesystem')
904
908
        self.assertEqual(id['ID_FS_TYPE'], type)
905
 
        self.assertEqual(id.get('ID_FS_LABEL', ''), label or '')
 
909
        l = id.get('ID_FS_LABEL', '')
 
910
        if type == 'vfat':
 
911
            l = l.lower()  # VFAT is case insensitive
 
912
        self.assertEqual(l, label or '')
906
913
 
907
914
        block = self.udisks_block()
908
915
        self.assertEqual(block.get_property('id-usage'), (type == 'swap') and 'other' or 'filesystem')
909
916
        self.assertEqual(block.get_property('id-type'), type)
910
 
        self.assertEqual(block.get_property('id-label'), label or '')
 
917
        l = block.get_property('id-label')
 
918
        if type == 'vfat':
 
919
            l = l.lower()  # VFAT is case insensitive
 
920
        self.assertEqual(l, label or '')
911
921
 
912
922
        if type == 'swap':
913
923
            return
925
935
 
926
936
        self.assertTrue('/media/' in mount_path)
927
937
        if label:
928
 
            self.assertTrue(mount_path.endswith(label))
 
938
            if type == 'vfat':
 
939
                self.assertTrue(mount_path.lower().endswith(label))
 
940
            else:
 
941
                self.assertTrue(mount_path.endswith(label))
929
942
 
930
943
        self.sync()
931
944
        self.assertEqual(fs.get_property('mount-points'), [mount_path])