VirtualBox

Ignore:
Timestamp:
Feb 22, 2018 9:39:33 AM (7 years ago)
Author:
vboxsync
Message:

bugref:8344. all cases have been unblocked. Added a comment with explanation of logic for 3d case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium1.py

    r71090 r71096  
    157157
    158158            #case 3. Path with file name
    159             #fRc = self.setLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments) and fRc
    160             #asNewFiles = ['newName' + os.path.splitext(s)[1] for s in asFiles]
    161             #fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments, asFiles) and fRc
    162             # BUG! the check above succeeds, but it actually should be the one below which does
    163             #fRc = self.checkLocation(sNewLoc, aoMediumAttachments, asNewFiles) and fRc
     159            #The case supposes that user has passed a destination path with a file name but hasn't added an extension/suffix
     160            #to this destination file. User supposes that the extension would be added automatically and to be the same as
     161            #for the original file. Difficult case, apparently this case should follow mv(1) logic
     162            #and the file name is processed as folder name (aka mv(1) logic).
     163            #Be discussed.
     164            fRc = self.setLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments) and fRc
     165            asNewFiles = ['newName' + os.path.splitext(s)[1] for s in asFiles]
     166            fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments, asFiles) and fRc
     167
     168            #after the case the destination path must be corrected
     169            sNewLoc = os.path.join(sNewLoc, 'newName')
    164170
    165171            #case 4. Only file name
    166             #fRc = self.setLocation('onlyMediumName', aoMediumAttachments) and fRc
    167             #asNewFiles = ['onlyMediumName' + os.path.splitext(s)[1] for s in asFiles]
    168             #fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments, asFiles) and fRc
    169                                 #     [s.replace('.hdd', '.parallels') for s in asNewFiles]) and fRc
    170             # BUG! due to the above path mishandling the check above succeeds, the directory issue is
    171             # a consequence of the bug in case 3, but the extension is also picked incorrectly, it is
    172             # not correct to just pick the backend id as the extension, it needs looking at the ext list.
    173             #fRc = self.checkLocation(sNewLoc, aoMediumAttachments, asNewFiles) and fRc
     172            fRc = self.setLocation('onlyMediumName', aoMediumAttachments) and fRc
     173            asNewFiles = ['onlyMediumName' + os.path.splitext(s)[1] for s in asFiles]
     174            fRc = self.checkLocation(sNewLoc, aoMediumAttachments, asNewFiles) and fRc
    174175
    175176            #case 5. Move all files from a snapshot
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette