misc,tests: Updated and generalized the resource url for tests
authorBobby R. Bruce <bbruce@ucdavis.edu>
Tue, 21 Apr 2020 09:22:14 +0000 (02:22 -0700)
committerBobby R. Bruce <bbruce@ucdavis.edu>
Sat, 25 Apr 2020 20:41:58 +0000 (20:41 +0000)
As we are now going to maintain different bundles of resources for each
gem5 release, the resources have been archived to
http://dist.gem5.org/dist/current for gem5 19. The development branch
will use http://dist.gem5.org/dist/develop going forward. New releases
will follow the format http://dist.gem5.org/dist/{VERSION}.

This patch makes the resources url a command-line parameter, set to the
"correct" url by default. This will be updated to the correct, archived,
version subdirectory upon release of a new gem5 version. E.g.:
http://dist.gem5.org/dist/v20 for the gem5 20 release.

Some Make files have been cleaned up to no longer fetch and push to
remote locations. As gem5-resources is implemented, sources will be
moved to the gem5-resources resository and compiled binaries, etc.
pulled from our Google Cloud bucket from the tests themselves.

Change-Id: Ia16c496be3a60283ecc431ffaa5b059e1932b526
Issue-on: https://gem5.atlassian.net/browse/GEM5-431
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27987
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
ext/testlib/config.py
tests/gem5/cpu_tests/test.py
tests/gem5/fs/linux/arm/test.py
tests/gem5/hello_se/test_hello_se.py
tests/gem5/insttest_se/test.py
tests/gem5/m5_util/test_exit.py
tests/gem5/m5threads_test_atomic/test.py
tests/gem5/x86-boot-tests/test_linux_boot.py
tests/test-progs/hello/src/Makefile.arm
tests/test-progs/hello/src/Makefile.x86
tests/test-progs/m5-exit/src/Makefile.x86

index 39d6a24cecb12e33c3af5aebd65d0b4dac3b8ea7..348d0a84c898e6fa7361bb8c6a0f4aef76beb409 100644 (file)
@@ -220,6 +220,7 @@ def define_defaults(defaults):
                                                       os.pardir))
     defaults.result_path = os.path.join(os.getcwd(), '.testing-results')
     defaults.list_only_failed = False
+    defaults.resource_url = 'http://dist.gem5.org/dist/develop'
 
 def define_constants(constants):
     '''
@@ -579,6 +580,12 @@ def define_common_args(config):
             default=None,
             help='Path where binaries are stored (downloaded if not present)'
         ),
+        Argument(
+            '--resource-url',
+            action='store',
+            default=config._defaults.resource_url,
+            help='The URL where the resources reside.'
+        ),
 
     ]
 
index ba90e2a90af55bee79b0e539f3cac92b44bb4f48..339d15aae08d1b2b715b159e252cb7907e1fe733 100644 (file)
@@ -56,7 +56,7 @@ if config.bin_path:
 else:
     base_path = joinpath(absdirpath(__file__), 'benchmarks', 'bin')
 
-base_url = 'http://dist.gem5.org/dist/current/gem5/cpu_tests/benchmarks/bin/'
+base_url = config.resource_url + '/gem5/cpu_tests/benchmarks/bin/'
 for isa in valid_isas:
     path = joinpath(base_path, isa)
     for workload in workloads:
index f90299bf3f88675d3f8704beba11e83a008258b3..39cb011359be117b462b12cd7550f6e618e54e90 100644 (file)
@@ -81,7 +81,7 @@ arm_fs_long_tests = [
 ]
 
 tarball = 'aarch-system-201901106.tar.bz2'
-url = "http://dist.gem5.org/dist/current/arm/" + tarball
+url = config.resource_url + "/arm/" + tarball
 filepath = os.path.dirname(os.path.abspath(__file__))
 path = config.bin_path if config.bin_path else filepath
 arm_fs_binaries = DownloadedArchive(url, path, tarball)
index 75043b91fb121d2b22b158f4b7052dbd0db74eef..260daad51122d1492615c09265cf3e618d519437 100644 (file)
@@ -81,7 +81,7 @@ else:
     base_path = joinpath(absdirpath(__file__), '..', 'test-progs', 'hello',
         'bin')
 
-urlbase = 'http://dist.gem5.org/dist/current/test-progs/hello/bin/'
+urlbase = config.resource_url + '/test-progs/hello/bin/'
 
 ref_path = joinpath(getcwd(), 'ref')
 verifiers = (
index c3fa3225cc0a8c8b426be10357b4f5466bccf865..6bddc8616f1368f4371ae2376ee71a5b920f6e15 100644 (file)
@@ -51,7 +51,7 @@ if config.bin_path:
 else:
     base_path = joinpath(absdirpath(__file__), '..', 'test-progs')
 
-urlbase = 'http://dist.gem5.org/dist/current/test-progs/insttest/bin/'
+urlbase = config.resource_url + '/test-progs/insttest/bin/'
 for isa in test_progs:
     for binary in test_progs[isa]:
         for  operating_s in supported_os[isa]:
index 02e97cfa69c7c3863070b619cc5edc9022902851..0a0dc1621cb4977f67d44ef5e5844de7032506de 100644 (file)
@@ -53,8 +53,7 @@ else:
     path = joinpath(absdirpath(__file__), '..',
                     'test-progs', 'hello', 'bin', 'x86', 'linux')
 filename = 'm5_exit'
-url = ('http://dist.gem5.org/dist/current/test-progs/' +
-       'm5-exit/bin/x86/linux/m5_exit')
+url = (config.resource_url + '/test-progs/m5-exit/bin/x86/linux/m5_exit')
 test_program = DownloadedProgram(url, path, filename)
 
 a = verifier.MatchRegex(m5_exit_regex)
index 64af6364c664524a108b1ad3c785cdbf9005abe8..b8e1e47ffb9270147a4c7d18e1f17190db1307d8 100644 (file)
@@ -38,7 +38,7 @@ else:
                          'test_atomic', 'bin')
 
 binary = 'test_atomic'
-url = 'http://dist.gem5.org/dist/current/test-progs/pthread/bin/' + binary
+url = config.resource_url + '/current/test-progs/pthread/bin/' + binary
 DownloadedProgram(url, base_path, binary)
 
 verifiers = (
index 0417eb9b738f463ae360dbad834954972eafb615..0e66659202bd59cfa41c48e80d8bd0daee883f9c 100644 (file)
@@ -34,8 +34,8 @@ else:
     base_path = joinpath(absdirpath(__file__), '..', 'resources',
             'ubuntu-boot')
 
-image_url = 'http://dist.gem5.org/images/x86/ubuntu-18-04/base.img'
-kernel_url = 'http://dist.gem5.org/kernels/x86/static/vmlinux-4.19.83'
+image_url = config.resource_url + '/images/x86/ubuntu-18-04/base.img'
+kernel_url = config.resource_url + '/kernels/x86/static/vmlinux-4.19.83'
 
 image_name = 'ubuntu-18-04-base.img'
 kernel_name = 'vmlinux-4.19.83' # 4.19 is LTS (Projected EOL: Dec, 2020)
index 1f022469dd5d1aedb4b58922fee1d5522f1e05bc..4a18483bd8943120547b9e5fc0d983ba2c4c0ae6 100644 (file)
@@ -1,13 +1,5 @@
-SERVER_USER=
-SERVER_PATH=/z/www/htdocs/dist/current/test-progs/hello/bin/arm/linux
-FETCH_PATH=http://dist.gem5.org/dist/current/test-progs/hello/bin/arm/linux
-UPLOAD_LOCATION=$(SERVER_USER)daystrom.gem5.org:$(SERVER_PATH)
-
 all: hello64-static hello32-static
 
-upload: hello64-static hello32-static
-       scp hello64-static hello32-static $(UPLOAD_LOCATION)
-
 hello64-static: hello.c dockcross-arm64
        ./dockcross-arm64 bash -c '$$CC hello.c -o hello64-static -static'
 
index 3df2d23c13101caf09e81d007b355de39c89544b..70d89b04631157af060c715a55af9570abfb839a 100644 (file)
@@ -1,15 +1,5 @@
-SERVER_USER=
-SERVER_PATH=/z/www/htdocs/dist/current/test-progs/hello/bin/x86/linux
-FETCH_PATH=http://dist.gem5.org/dist/current/test-progs/hello/bin/x86/linux
-
-UPLOAD_LOCATION=$(SERVER_USER)daystrom.gem5.org:$(SERVER_PATH)
-
 all: hello64-static hello64-dynamic hello32-static
 
-
-upload: hello64-static hello64-dynamic hello32-static
-       scp hello64-static hello64-dynamic hello32-static $(UPLOAD_LOCATION)
-
 hello64-static: hello.c dockcross-x64
        ./dockcross-x64 bash -c '$$CC hello.c -o hello64-static -static'
 
index 2c94a54c9a7ea35c3148cc6f9af38680bb5f66e8..4ab1b875ece869c24b42c2e033e2d52eea3cdab7 100644 (file)
@@ -1,17 +1,8 @@
-SERVER_USER=
-SERVER_PATH=/z/www/htdocs/dist/current/test-progs/m5-exit/bin/x86/linux
-FETCH_PATH=http://dist.gem5.org/dist/current/test-progs/m5-exit/bin/x86/linux
-
-UPLOAD_LOCATION=$(SERVER_USER)daystrom.gem5.org:$(SERVER_PATH)
-
 M5_UTIL:=${CURDIR}/../../../../util/m5
 M5_INCLUDE:=${CURDIR}/../../../../include/
 
 all: m5_exit
 
-upload: m5_exit
-       scp m5_exit $(UPLOAD_LOCATION)
-
 # NOTE: For docker to work, all of the files must be in this directory
 m5_exit: m5-exit.c
        cp -r $(M5_INCLUDE)/gem5 .