diff --git a/build/gen_test_packages_manifest.py b/build/gen_test_packages_manifest.py index d5afe4f51cb08..54814f634dba6 100644 --- a/build/gen_test_packages_manifest.py +++ b/build/gen_test_packages_manifest.py @@ -21,6 +21,7 @@ 'raptor', 'awsy', 'gtest', + 'updater-dep' ] PACKAGE_SPECIFIED_HARNESSES = [ @@ -32,6 +33,7 @@ 'talos', 'raptor', 'awsy', + 'updater-dep', ] # These packages are not present for every build configuration. diff --git a/python/mozbuild/mozbuild/action/test_archive.py b/python/mozbuild/mozbuild/action/test_archive.py index 7278d54ce4785..a5b01e710a949 100644 --- a/python/mozbuild/mozbuild/action/test_archive.py +++ b/python/mozbuild/mozbuild/action/test_archive.py @@ -110,6 +110,7 @@ 'awsy/**', 'web-platform/**', 'xpcshell/**', + 'updater-dep/**', ], }, { @@ -519,6 +520,21 @@ 'dest': 'xpcshell', }, ], + 'updater-dep': [ + { + 'source': buildconfig.topobjdir, + 'base': '_tests/updater-dep', + 'pattern': '**', + 'dest': 'updater-dep', + }, + # Required by the updater on Linux + { + 'source': buildconfig.topobjdir, + 'base': 'config/external/sqlite', + 'pattern': 'libmozsqlite3.so', + 'dest': 'updater-dep', + }, + ], } if buildconfig.substs.get('MOZ_CODE_COVERAGE'): @@ -626,7 +642,7 @@ def find_files(archive): '**/*.pyc', ]) - if archive != 'common' and base.startswith('_tests'): + if archive not in ('common', 'updater-dep') and base.startswith('_tests'): # We may have generated_harness_files to exclude from this entry. for path in generated_harness_files: if path.startswith(base): diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index 54986bc7913f5..62f2ff886d0ba 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -125,6 +125,7 @@ TEST_PKGS_TARGZ := \ awsy \ xpcshell \ web-platform \ + updater-dep \ $(NULL) ifdef LINK_GTEST_DURING_COMPILE diff --git a/toolkit/mozapps/update/updater/archivereader.cpp b/toolkit/mozapps/update/updater/archivereader.cpp index 7c32b4a49dffa..aafc1fe1a2914 100644 --- a/toolkit/mozapps/update/updater/archivereader.cpp +++ b/toolkit/mozapps/update/updater/archivereader.cpp @@ -25,6 +25,9 @@ #ifdef MOZ_VERIFY_MAR_SIGNATURE #ifdef TEST_UPDATER #include "../xpcshellCert.h" +#elif DEP_UPDATER +#include "../dep1Cert.h" +#include "../dep2Cert.h" #else #include "primaryCert.h" #include "secondaryCert.h" @@ -87,6 +90,11 @@ ArchiveReader::VerifySignature() #else #ifdef TEST_UPDATER int rv = VerifyLoadedCert(mArchive, xpcshellCertData); +#elif DEP_UPDATER + int rv = VerifyLoadedCert(mArchive, dep1CertData); + if (rv != OK) { + rv = VerifyLoadedCert(mArchive, dep2CertData); + } #else int rv = VerifyLoadedCert(mArchive, primaryCertData); if (rv != OK) { diff --git a/toolkit/mozapps/update/updater/moz.build b/toolkit/mozapps/update/updater/moz.build index 15a420607ca7e..4d67dc94ad582 100644 --- a/toolkit/mozapps/update/updater/moz.build +++ b/toolkit/mozapps/update/updater/moz.build @@ -11,6 +11,7 @@ else: updater_rel_path = '' include('updater-common.build') +DIRS += ['updater-dep'] if CONFIG['ENABLE_TESTS']: DIRS += ['updater-xpcshell'] @@ -25,6 +26,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': SRCDIR + '/Launchd.plist'] GENERATED_FILES = [ + 'dep1Cert.h', + 'dep2Cert.h', 'primaryCert.h', 'secondaryCert.h', 'xpcshellCert.h', @@ -37,10 +40,14 @@ secondary_cert = GENERATED_FILES['secondaryCert.h'] # have to regenerate it. # ./certutil -L -d modules/libmar/tests/unit/data -n mycert -r > xpcshellCertificate.der xpcshell_cert = GENERATED_FILES['xpcshellCert.h'] +dep1_cert = GENERATED_FILES['dep1Cert.h'] +dep2_cert = GENERATED_FILES['dep2Cert.h'] primary_cert.script = 'gen_cert_header.py:create_header' secondary_cert.script = 'gen_cert_header.py:create_header' xpcshell_cert.script = 'gen_cert_header.py:create_header' +dep1_cert.script = 'gen_cert_header.py:create_header' +dep2_cert.script = 'gen_cert_header.py:create_header' if CONFIG['MOZ_UPDATE_CHANNEL'] in ('beta', 'release', 'esr'): primary_cert.inputs += ['release_primary.der'] @@ -54,6 +61,8 @@ else: primary_cert.inputs += ['dep1.der'] secondary_cert.inputs += ['dep2.der'] +dep1_cert.inputs += ['dep1.der'] +dep2_cert.inputs += ['dep2.der'] xpcshell_cert.inputs += ['xpcshellCertificate.der'] if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: diff --git a/toolkit/mozapps/update/updater/updater-dep/Makefile.in b/toolkit/mozapps/update/updater/updater-dep/Makefile.in new file mode 100644 index 0000000000000..2532725defbc4 --- /dev/null +++ b/toolkit/mozapps/update/updater/updater-dep/Makefile.in @@ -0,0 +1,20 @@ +# vim:set ts=8 sw=8 sts=8 noet: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# For changes here, also consider ../Makefile.in + +include $(topsrcdir)/config/rules.mk + +tools:: +ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) + # Copy for xpcshell tests + $(NSINSTALL) -D $(FINAL_TARGET)/updater-dep.app + rsync -a -C --exclude '*.in' $(srcdir)/../macbuild/Contents $(FINAL_TARGET)/updater-dep.app + sed -e 's/%APP_NAME%/$(MOZ_APP_DISPLAYNAME)/' $(srcdir)/../macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | \ + iconv -f UTF-8 -t UTF-16 > $(FINAL_TARGET)/updater-dep.app/Contents/Resources/English.lproj/InfoPlist.strings + $(NSINSTALL) -D $(FINAL_TARGET)/updater-dep.app/Contents/MacOS + $(NSINSTALL) $(FINAL_TARGET)/updater-dep $(FINAL_TARGET)/updater-dep.app/Contents/MacOS + mv $(FINAL_TARGET)/updater-dep.app/Contents/MacOS/updater-dep $(FINAL_TARGET)/updater-dep.app/Contents/MacOS/org.mozilla.updater +endif diff --git a/toolkit/mozapps/update/updater/updater-dep/moz.build b/toolkit/mozapps/update/updater/updater-dep/moz.build new file mode 100644 index 0000000000000..ee6bd8ea6c6f4 --- /dev/null +++ b/toolkit/mozapps/update/updater/updater-dep/moz.build @@ -0,0 +1,14 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +FINAL_TARGET = '_tests/updater-dep' + +Program('updater-dep') + +updater_rel_path = '../' +DEFINES['DEP_UPDATER'] = True +include('../updater-common.build') + diff --git a/toolkit/mozapps/update/updater/updater.rc b/toolkit/mozapps/update/updater/updater.rc index 7603eecb645ae..aff834a59769e 100644 --- a/toolkit/mozapps/update/updater/updater.rc +++ b/toolkit/mozapps/update/updater/updater.rc @@ -4,7 +4,7 @@ // Microsoft Visual C++ generated resource script. // -#ifdef TEST_UPDATER +#if defined(TEST_UPDATER) || defined(DEP_UPDATER) #include "../resource.h" #define MANIFEST_PATH "../updater.exe.manifest" #define COMCTL32_MANIFEST_PATH "../updater.exe.comctl32.manifest"