1. 19 7月, 2018 1 次提交
  2. 17 7月, 2018 12 次提交
  3. 16 7月, 2018 7 次提交
    • L
      Merging pull request 2710 · 9d2ead14
      Lukáš Doktor 提交于
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      
      * https://github.com/avocado-framework/avocado:
        Asset Fetcher: avoid clashes by using namespace dirs
        Asset Fetcher: add a fetch/build example test
        avocado/utils/build.py: add a configure utility function
        Asset Fetcher: remove hashfile attribute
        Asset Fetcher: remove attribute asset_file
        Asset fetcher: remove public attributes nameobj and basename
      9d2ead14
    • C
      Asset Fetcher: avoid clashes by using namespace dirs · 111c2a80
      Cleber Rosa 提交于
      The current implementation fails to cache multiple files if their
      name is the same.  The filename *only* will be considered when
      looking at the cached directories, and if hashes are not given,
      users will end up with the wrong files, even when they give
      unique URLs to different files.
      
      To give a real example, suppose we have one test that needs a specific
      asset file (such as an specific kernel version):
      
         def test_x86_64(self):
            self.fetch_asset('https://avocado-project.org/data/linux/x86_64/vmlinuz',
                             asset_hash='0123456789abcdef...')
      
      While a second test wants the daily version of a given asset:
      
        def test_aarch64(self):
            self.fetch_asset('https://avocado-project.org/data/linux/aarch64/vmlinuz',
                             expire='1d')
      
      If test_x86_64() runs first, it will write to $CACHE_DIR/vmlinuz.  The
      second test, test_aarch64(), may end up having the completely wrong
      file.  Using `asset_cache` is not a possibility, given that it wants
      the daily kernel.
      
      These changes put asset files on a "cache relative directory".  If a
      hash is given, it's safe to put files in a directory indexed "by
      name".  If not, they're put in a directory named after the URL (minus
      the filename).
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      111c2a80
    • C
      Asset Fetcher: add a fetch/build example test · a1855314
      Cleber Rosa 提交于
      This example test fetches two different files from different
      locations, and uses a data file (shipped *with* the test) on
      one of them.
      
      The goal is to demonstrate a complete example of files you
      may want to distribute with your test, and the assets you
      may want to fetch from remote locations.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      a1855314
    • C
      avocado/utils/build.py: add a configure utility function · bc6c12d5
      Cleber Rosa 提交于
      The most common workflow when building software from source is to
      configure the source, and then build it.  Avocado provides a utility
      "make" function, but when users need to run "configure" or similar
      scripts, there's no shortcut.
      
      This introduces a configure script, which when used with no explicit
      configure script name, will attempt to find a couple of suitable
      scripts, but will forgive the source tree if one doesn't exist.
      
      This allows test writers to use the following pattern:
      
         from avocado.utils import build
         build.configure("/path/to/src")
         build.make("/path/to/src")
      
      And have successful results in most source code repositories.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      bc6c12d5
    • C
      Asset Fetcher: remove hashfile attribute · cc2bccc9
      Cleber Rosa 提交于
      In another part of the purge of attributes, let's remove hashfile.
      This attribute is yet another case of an attribute that is not
      intended for end users, and basically serves as a way to pass
      information across methods.
      
      Because the hash file name is so easily computable, instead of turning
      it into a private, let's just evaluate the hash file name when needed.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      cc2bccc9
    • C
      Asset Fetcher: remove attribute asset_file · 8b768865
      Cleber Rosa 提交于
      This attribute is not really a class attribute intended for users,
      but a way to pass internal data among methods.
      
      Let's make parameters explicit and remove this attribute.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      8b768865
    • C
      Asset fetcher: remove public attributes nameobj and basename · 1c2c7560
      Cleber Rosa 提交于
      These attributes are purely internal, and are used only once.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      1c2c7560
  4. 14 7月, 2018 8 次提交
  5. 13 7月, 2018 1 次提交
  6. 12 7月, 2018 1 次提交
  7. 11 7月, 2018 2 次提交
  8. 10 7月, 2018 4 次提交
  9. 04 7月, 2018 4 次提交