Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-2209

Arquillian Drone extension doesn't perform MD5 / SHA256 sum check of existing browser webdriver / Selenium server jars prior automatic download, possibly leading to reuse of corrupted / partial *.bz2 archives, leading to test failures

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Extension - Drone
    • None
    • Hide

      How Reproducible:

      Always

       

      Affected Version:

      v2.5.1

       

      Steps To Reproduce:

      This happened to me when previous download of https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 archive didn't completely finish – got:

       

      $ du -h /home/iankko/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
      6.3M	/home/iankko/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
       

      instead of expected:

      $ du -h phantomjs-2.1.1-linux-x86_64.tar.bz2 
      23M	phantomjs-2.1.1-linux-x86_64.tar.bz2
      

       
      But might be possible (didn't try it though) to simulate this by:

      • Create valid Bzip2 archive at:
         

        /home/$USER/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2

        {noormat}
      • Run some test using PhantomJS driver

      Current Result:
      Existing phantomjs.* archive is tried to be used.

      Expected Result:
      MD5 / SHA256 checksum of the existing file is compared with the checksum of the remote original file, and if not matching the download of the archive is retried / repeated.

      Show
      How Reproducible: Always   Affected Version: v2.5.1   Steps To Reproduce: This happened to me when previous download of https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 archive didn't completely finish – got:   $ du -h /home/iankko/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2 6.3M /home/iankko/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2 instead of expected: $ du -h phantomjs-2.1.1-linux-x86_64.tar.bz2 23M phantomjs-2.1.1-linux-x86_64.tar.bz2   But might be possible (didn't try it though) to simulate this by: Create valid Bzip2 archive at:   /home/$USER/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2 {noormat} Run some test using PhantomJS driver Current Result: Existing phantomjs.* archive is tried to be used. Expected Result: MD5 / SHA256 checksum of the existing file is compared with the checksum of the remote original file, and if not matching the download of the archive is retried / repeated.
    • Workaround Exists
      1. Ensure the expected $HOME/.arquillian/drone/subdirectory_specific_to_binary archive has correct size / checksum.
      2. Rerun the test.
    • Undefined

      From How it works? section of Arquillian Drone extension:

      Let say that I want to use Chrome for my UI tests. First of all, Drone checks if the path to the webdriver binary isn’t already set. In this case it would check a system property webdriver.chrome.driver; if this is empty then it checks arquillian.xml property: chromeDriverBinary. In case that both properties are empty, then the automatic download comes up.

      Now we have several options how to specify which binary should be downloaded and where it should be stored. For storage purposes cache directories $HOME/.arquillian/drone/subdirectory_specific_to_binary are used so the binaries are not downloaded over and over again.

      The fact / behavior about not repeating the downloads of possibly previously existing WebDriver binaries required by the environment / test is OK.

      The issue is once the $HOME/.arquillian/drone/subdirectory_specific_to_binary location already exists (example: /home/iankko/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2) the MD5 / SHA256 checksum of the archive isn't compared against the checksum of the original file, that was supposed to be downloaded possibly leading to expand / untar corrupted / partial *.bz2 files:

      $ md5sum  /home/iankko/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
      40ead921d7796808e972ae0e96204481  /home/iankko/.arquillian/drone/phantomjs/2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
      

      while the MD5 sum of the original file, expected to be downloaded:
      https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2

      is completely different:

      $ wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
      
      $ md5sum phantomjs-2.1.1-linux-x86_64.tar.bz2 
      1c947d57fce2f21ce0b43fe2ed7cd361  phantomjs-2.1.1-linux-x86_64.tar.bz2
      

      Further information:
      See KEYCLOAK-16434 issue for more details / steps about how this issue was recognized by running Keycloak's Javascript adapter test.

              Unassigned Unassigned
              rhn-jlieskov Ján Lieskovský (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: