SERVER-123808 split crypt package testing into a separate task (#51606)
GitOrigin-RevId: 45375596568104f9d2c4c3300a69900c78cfa518
This commit is contained in:
parent
9ee60a7462
commit
0150f40373
@ -38,7 +38,45 @@ handler.setFormatter(formatter)
|
||||
root.addHandler(handler)
|
||||
|
||||
|
||||
def download_packages_from_build(build_id: str, download_dir: Path) -> Path:
|
||||
def find_build_task(tasks: list[Any], task_display_name: str) -> Any:
|
||||
"""Find a unique Evergreen task by display name."""
|
||||
|
||||
matching_tasks = [task for task in tasks if task.display_name == task_display_name]
|
||||
|
||||
if not matching_tasks:
|
||||
raise RuntimeError(f"Could not find task '{task_display_name}' in build task list")
|
||||
|
||||
if len(matching_tasks) > 1:
|
||||
matching_task_ids = ", ".join(task.task_id for task in matching_tasks)
|
||||
raise RuntimeError(
|
||||
f"Found multiple tasks named '{task_display_name}' in build task list: {matching_task_ids}"
|
||||
)
|
||||
|
||||
return matching_tasks[0]
|
||||
|
||||
|
||||
def find_task_artifact_url(task: Any, artifact_name: str) -> str:
|
||||
"""Find a unique artifact URL on a task."""
|
||||
|
||||
matching_artifacts = [artifact for artifact in task.artifacts if artifact.name == artifact_name]
|
||||
|
||||
if not matching_artifacts:
|
||||
raise RuntimeError(
|
||||
f"Could not find '{artifact_name}' artifact for task {task.task_id} ({task.display_name})"
|
||||
)
|
||||
|
||||
if len(matching_artifacts) > 1:
|
||||
matching_urls = ", ".join(artifact.url for artifact in matching_artifacts)
|
||||
raise RuntimeError(
|
||||
f"Found multiple '{artifact_name}' artifacts for task {task.task_id}: {matching_urls}"
|
||||
)
|
||||
|
||||
return matching_artifacts[0].url
|
||||
|
||||
|
||||
def download_packages_from_build(
|
||||
build_id: str, download_dir: Path, package_task_display_name: str = "package"
|
||||
) -> Path:
|
||||
"""
|
||||
Download the packages artifact from the Evergreen API.
|
||||
|
||||
@ -49,37 +87,25 @@ def download_packages_from_build(build_id: str, download_dir: Path) -> Path:
|
||||
Args:
|
||||
build_id: The Evergreen build ID to search for the package task
|
||||
download_dir: Directory where the packages tarball should be downloaded
|
||||
package_task_display_name: The Evergreen task display name that owns the Packages artifact
|
||||
|
||||
Returns:
|
||||
The local path to the downloaded packages tarball
|
||||
"""
|
||||
logging.info("Fetching packages artifact from Evergreen API for build: %s", build_id)
|
||||
logging.info(
|
||||
"Fetching packages artifact from Evergreen API for build: %s (task: %s)",
|
||||
build_id,
|
||||
package_task_display_name,
|
||||
)
|
||||
|
||||
evg_api = evergreen_conn.get_evergreen_api()
|
||||
tasks = evg_api.tasks_by_build(build_id)
|
||||
|
||||
package_task = None
|
||||
for task in tasks:
|
||||
if task.display_name == "package":
|
||||
package_task = task
|
||||
break
|
||||
|
||||
if package_task is None:
|
||||
raise RuntimeError(f"Could not find 'package' task in build {build_id}")
|
||||
|
||||
package_task = find_build_task(tasks, package_task_display_name)
|
||||
logging.info("Found package task: %s", package_task.task_id)
|
||||
|
||||
packages_url = None
|
||||
for artifact in package_task.artifacts:
|
||||
if artifact.name == "Packages":
|
||||
packages_url = artifact.url
|
||||
logging.info("Found Packages artifact URL: %s", packages_url)
|
||||
break
|
||||
|
||||
if packages_url is None:
|
||||
raise RuntimeError(
|
||||
f"Could not find 'Packages' artifact for package task {package_task.task_id}"
|
||||
)
|
||||
packages_url = find_task_artifact_url(package_task, "Packages")
|
||||
logging.info("Found Packages artifact URL: %s", packages_url)
|
||||
|
||||
# Download the packages file
|
||||
download_dir.mkdir(parents=True, exist_ok=True)
|
||||
@ -749,6 +775,12 @@ branch_test_parser.add_argument(
|
||||
"from the Evergreen API (required for private artifacts).",
|
||||
default=None,
|
||||
)
|
||||
branch_test_parser.add_argument(
|
||||
"--evg-package-task-name",
|
||||
type=str,
|
||||
help="Evergreen task display name that owns the Packages artifact when using --evg-build-id.",
|
||||
default="package",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.command == "release":
|
||||
@ -778,7 +810,9 @@ if args.command == "branch":
|
||||
local_packages_path: Optional[Path] = None
|
||||
if args.evg_build_id:
|
||||
download_dir = Path(__file__).parent / "downloaded_packages"
|
||||
local_packages_path = download_packages_from_build(args.evg_build_id, download_dir)
|
||||
local_packages_path = download_packages_from_build(
|
||||
args.evg_build_id, download_dir, args.evg_package_task_name
|
||||
)
|
||||
|
||||
for test_pair in args.test:
|
||||
test_os = test_pair[0]
|
||||
@ -827,13 +861,12 @@ if args.command == "branch":
|
||||
)
|
||||
)
|
||||
|
||||
validate_top_level_directory("mongo-binaries.tgz")
|
||||
|
||||
if not args.skip_enterprise_check:
|
||||
logging.info(
|
||||
"Checking the source files used to build the binaries, use --skip-enterprise-check to skip this check."
|
||||
)
|
||||
|
||||
validate_top_level_directory("mongo-binaries.tgz")
|
||||
os.makedirs("dist-test", exist_ok=True)
|
||||
|
||||
tar = tarfile.open("mongo-binaries.tgz", "r:gz")
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
# This script needs to be compatible with odler versions of python since it runs on older versions of OSs when testing packaging
|
||||
# For example ubuntu 1604 uses python3.5
|
||||
|
||||
import grp
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import pathlib
|
||||
import platform
|
||||
import pwd
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
@ -18,19 +16,19 @@ import traceback
|
||||
from logging.handlers import WatchedFileHandler
|
||||
from typing import Dict, List, Optional, Tuple, Union
|
||||
|
||||
try:
|
||||
import grp
|
||||
except ImportError:
|
||||
grp = None
|
||||
|
||||
try:
|
||||
import pwd
|
||||
except ImportError:
|
||||
pwd = None
|
||||
|
||||
root = logging.getLogger()
|
||||
root.setLevel(logging.DEBUG)
|
||||
|
||||
stdout_handler = logging.StreamHandler(sys.stdout)
|
||||
stdout_handler.setLevel(logging.DEBUG)
|
||||
file_handler = WatchedFileHandler(sys.argv[1], mode="w", encoding="utf8")
|
||||
file_handler.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter("[%(asctime)s]%(levelname)s:%(message)s")
|
||||
stdout_handler.setFormatter(formatter)
|
||||
file_handler.setFormatter(formatter)
|
||||
root.addHandler(stdout_handler)
|
||||
root.addHandler(file_handler)
|
||||
|
||||
DOCKER_SYSTEMCTL_REPO = "https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement"
|
||||
SYSTEMCTL_URL = (
|
||||
DOCKER_SYSTEMCTL_REPO + "/eb2a963a7d8413119b432bcb6151af6076b65f84/files/docker/systemctl3.py"
|
||||
@ -40,10 +38,102 @@ JOURNALCTL_URL = (
|
||||
)
|
||||
|
||||
TestArgs = Dict[str, Union[str, int, List[str]]]
|
||||
test_args = {} # type: TestArgs
|
||||
|
||||
SERVER_PACKAGE_RE = re.compile(r"^mongodb-(?:org|enterprise)(?:-unstable)?(?:-server)?$")
|
||||
CRYPT_V1_PACKAGE_RE = re.compile(r"^mongodb-enterprise(?:-unstable)?-crypt-v1$")
|
||||
_LOGGING_CONFIGURED = False
|
||||
|
||||
|
||||
def run_and_log(cmd: str, end_on_error: bool = True):
|
||||
# type: (str, bool) -> 'subprocess.CompletedProcess[bytes]'
|
||||
def configure_logging(log_path: str) -> None:
|
||||
global _LOGGING_CONFIGURED
|
||||
|
||||
if _LOGGING_CONFIGURED:
|
||||
return
|
||||
|
||||
stdout_handler = logging.StreamHandler(sys.stdout)
|
||||
stdout_handler.setLevel(logging.DEBUG)
|
||||
file_handler = WatchedFileHandler(log_path, mode="w", encoding="utf8")
|
||||
file_handler.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter("[%(asctime)s]%(levelname)s:%(message)s")
|
||||
stdout_handler.setFormatter(formatter)
|
||||
file_handler.setFormatter(formatter)
|
||||
root.addHandler(stdout_handler)
|
||||
root.addHandler(file_handler)
|
||||
_LOGGING_CONFIGURED = True
|
||||
|
||||
|
||||
def is_server_package(package_name: str) -> bool:
|
||||
return SERVER_PACKAGE_RE.match(package_name) is not None
|
||||
|
||||
|
||||
def is_crypt_v1_package(package_name: str) -> bool:
|
||||
return CRYPT_V1_PACKAGE_RE.match(package_name) is not None
|
||||
|
||||
|
||||
def get_package_kind(package_names: List[str]) -> str:
|
||||
if any(is_server_package(package_name) for package_name in package_names):
|
||||
return "server"
|
||||
|
||||
if any(is_crypt_v1_package(package_name) for package_name in package_names):
|
||||
return "crypt_v1"
|
||||
|
||||
raise RuntimeError("Unsupported package set: {}".format(", ".join(package_names)))
|
||||
|
||||
|
||||
def get_required_files(test_args: TestArgs) -> List[pathlib.Path]:
|
||||
if test_args["package_kind"] == "server":
|
||||
return [
|
||||
pathlib.Path("/etc/mongod.conf"),
|
||||
pathlib.Path("/usr/bin/mongod"),
|
||||
pathlib.Path("/var/log/mongodb/mongod.log"),
|
||||
pathlib.Path(test_args["systemd_units_dir"]) / "mongod.service",
|
||||
]
|
||||
|
||||
if test_args["package_kind"] == "crypt_v1":
|
||||
return [
|
||||
pathlib.Path("/usr/include/mongo_crypt/v1/mongo_crypt/mongo_crypt.h"),
|
||||
pathlib.Path(test_args["lib_dir"]) / "mongo_crypt_v1.so",
|
||||
]
|
||||
|
||||
raise RuntimeError("Unknown package kind: {}".format(test_args["package_kind"]))
|
||||
|
||||
|
||||
def get_required_dirs(test_args: TestArgs) -> List[pathlib.Path]:
|
||||
if test_args["package_kind"] != "server":
|
||||
return []
|
||||
|
||||
required_dirs = [
|
||||
pathlib.Path("/run/mongodb"),
|
||||
pathlib.Path("/var/run/mongodb"),
|
||||
pathlib.Path(test_args["mongo_work_dir"]),
|
||||
] # type: List[pathlib.Path]
|
||||
|
||||
if test_args["package_manager"] in ("yum", "zypper"):
|
||||
# Only RPM-based distros create the home directory. Debian/Ubuntu
|
||||
# distros use a non-existent directory in /home
|
||||
required_dirs.append(pathlib.Path(test_args["mongo_home_dir"]))
|
||||
|
||||
return required_dirs
|
||||
|
||||
|
||||
def get_leftover_files(test_args: TestArgs) -> List[pathlib.Path]:
|
||||
if test_args["package_kind"] == "server":
|
||||
return [
|
||||
pathlib.Path("/usr/bin/mongod"),
|
||||
pathlib.Path(test_args["systemd_units_dir"]) / "mongod.service",
|
||||
]
|
||||
|
||||
if test_args["package_kind"] == "crypt_v1":
|
||||
return [
|
||||
pathlib.Path("/usr/include/mongo_crypt/v1/mongo_crypt/mongo_crypt.h"),
|
||||
pathlib.Path(test_args["lib_dir"]) / "mongo_crypt_v1.so",
|
||||
]
|
||||
|
||||
raise RuntimeError("Unknown package kind: {}".format(test_args["package_kind"]))
|
||||
|
||||
|
||||
def run_and_log(cmd: str, end_on_error: bool = True) -> subprocess.CompletedProcess:
|
||||
proc = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
logging.debug(cmd)
|
||||
logging.debug(proc.stdout.decode("UTF-8").strip())
|
||||
@ -106,8 +196,9 @@ def run_zypper_test(packages: List[str]):
|
||||
run_and_log("zypper -n --no-gpg-checks install {}".format(" ".join(packages)))
|
||||
|
||||
|
||||
def run_mongo_query(shell, query, should_fail=False, tries=60, interval=1.0):
|
||||
# type: (str, bool, int, float) -> Optional[subprocess.CompletedProcess[bytes]]
|
||||
def run_mongo_query(
|
||||
shell: str, query: str, should_fail: bool = False, tries: int = 60, interval: float = 1.0
|
||||
) -> Optional[subprocess.CompletedProcess]:
|
||||
assert tries >= 1
|
||||
|
||||
exec_result = None # type: Union[subprocess.CompletedProcess[bytes], None]
|
||||
@ -234,11 +325,13 @@ def get_test_args(package_manager: str, package_files: List[str]) -> TestArgs:
|
||||
test_args["mongo_home_dir"] = "/var/lib/mongo"
|
||||
test_args["mongo_work_dir"] = "/var/lib/mongo"
|
||||
test_args["mongo_user_shell"] = "/bin/false"
|
||||
test_args["lib_dir"] = run_and_log("rpm --eval '%{_libdir}'").stdout.decode("utf-8").strip()
|
||||
else:
|
||||
test_args["mongo_username"] = "mongodb"
|
||||
test_args["mongo_groupname"] = "mongodb"
|
||||
test_args["mongo_home_dir"] = "/home/mongodb"
|
||||
test_args["mongo_work_dir"] = "/var/lib/mongodb"
|
||||
test_args["lib_dir"] = "/usr/lib"
|
||||
|
||||
if (os_name == "debian" and os_version_major >= 10) or (
|
||||
os_name == "ubuntu" and os_version_major >= 18
|
||||
@ -268,6 +361,7 @@ def get_test_args(package_manager: str, package_files: List[str]) -> TestArgs:
|
||||
for package in package_files:
|
||||
package_names.append(get_package_name(package))
|
||||
test_args["package_names"] = package_names
|
||||
test_args["package_kind"] = get_package_kind(package_names)
|
||||
|
||||
if pathlib.Path("/usr/bin/systemd").exists():
|
||||
test_args["systemd_path"] = "/usr/bin"
|
||||
@ -332,23 +426,8 @@ def test_start():
|
||||
def test_install_is_complete(test_args: TestArgs):
|
||||
logging.info("Checking that the installation is complete.")
|
||||
|
||||
required_files = [
|
||||
pathlib.Path("/etc/mongod.conf"),
|
||||
pathlib.Path("/usr/bin/mongod"),
|
||||
pathlib.Path("/var/log/mongodb/mongod.log"),
|
||||
pathlib.Path(test_args["systemd_units_dir"]) / "mongod.service",
|
||||
] # type: List[pathlib.Path]
|
||||
|
||||
required_dirs = [
|
||||
pathlib.Path("/run/mongodb"),
|
||||
pathlib.Path("/var/run/mongodb"),
|
||||
pathlib.Path(test_args["mongo_work_dir"]),
|
||||
] # type: List[pathlib.Path]
|
||||
|
||||
if test_args["package_manager"] in ("yum", "zypper"):
|
||||
# Only RPM-based distros create the home directory. Debian/Ubuntu
|
||||
# distros use a non-existent directory in /home
|
||||
required_dirs.append(pathlib.Path(test_args["mongo_home_dir"]))
|
||||
required_files = get_required_files(test_args)
|
||||
required_dirs = get_required_dirs(test_args)
|
||||
|
||||
for path in required_files:
|
||||
if not (path.exists() and path.is_file()):
|
||||
@ -358,23 +437,31 @@ def test_install_is_complete(test_args: TestArgs):
|
||||
if not (path.exists() and path.is_dir()):
|
||||
raise RuntimeError("Required directory missing: {}".format(path))
|
||||
|
||||
if test_args["package_kind"] != "server":
|
||||
return
|
||||
|
||||
grp_module = grp
|
||||
pwd_module = pwd
|
||||
if pwd_module is None or grp_module is None:
|
||||
raise RuntimeError("POSIX account lookup modules are unavailable on this platform")
|
||||
|
||||
try:
|
||||
user_info = pwd.getpwnam(test_args["mongo_username"])
|
||||
user_info = pwd_module.getpwnam(test_args["mongo_username"])
|
||||
except KeyError:
|
||||
raise RuntimeError("Required user missing: {}".format(test_args["mongo_username"]))
|
||||
|
||||
try:
|
||||
grp.getgrnam(test_args["mongo_groupname"])
|
||||
grp_module.getgrnam(test_args["mongo_groupname"])
|
||||
except KeyError:
|
||||
raise RuntimeError("Required group missing: {}".format(test_args["mongo_username"]))
|
||||
|
||||
# All of the supplemental groups (the .deb pattern)
|
||||
mongo_user_groups = [
|
||||
g.gr_name for g in grp.getgrall() if test_args["mongo_username"] in g.gr_mem
|
||||
g.gr_name for g in grp_module.getgrall() if test_args["mongo_username"] in g.gr_mem
|
||||
]
|
||||
|
||||
# The user's primary group (the .rpm pattern)
|
||||
mongo_user_groups.append(grp.getgrgid(user_info.pw_gid).gr_name)
|
||||
mongo_user_groups.append(grp_module.getgrgid(user_info.pw_gid).gr_name)
|
||||
|
||||
if test_args["mongo_groupname"] not in mongo_user_groups:
|
||||
raise RuntimeError(
|
||||
@ -490,54 +577,68 @@ def test_uninstall(test_args: TestArgs):
|
||||
def test_uninstall_is_complete(test_args: TestArgs):
|
||||
logging.info("Checking that the uninstallation is complete.")
|
||||
|
||||
leftover_files = [
|
||||
pathlib.Path("/usr/bin/mongod"),
|
||||
pathlib.Path(test_args["systemd_units_dir"]) / "mongod.service",
|
||||
] # type: List[pathlib.Path]
|
||||
leftover_files = get_leftover_files(test_args)
|
||||
|
||||
for path in leftover_files:
|
||||
if path.exists():
|
||||
raise RuntimeError("Failed to uninstall cleanly, found: {}".format(path))
|
||||
|
||||
|
||||
package_urls = sys.argv[2:]
|
||||
def main() -> int:
|
||||
global test_args
|
||||
|
||||
if len(package_urls) == 0:
|
||||
logging.error("No packages to test... Failing test")
|
||||
sys.exit(1)
|
||||
if len(sys.argv) < 3:
|
||||
print("Usage: {} <log-path> <package-url> [package-url ...]".format(sys.argv[0]))
|
||||
return 1
|
||||
|
||||
package_files = download_extract_all_packages(package_urls)
|
||||
configure_logging(sys.argv[1])
|
||||
package_urls = sys.argv[2:]
|
||||
|
||||
package_manager = "" # type: str
|
||||
apt_proc = run_and_log("apt --help", end_on_error=False)
|
||||
yum_proc = run_and_log("yum --help", end_on_error=False)
|
||||
zypper_proc = run_and_log("zypper -n --help", end_on_error=False)
|
||||
# zypper
|
||||
if apt_proc.returncode == 0:
|
||||
run_apt_test(packages=package_files)
|
||||
package_manager = "apt"
|
||||
elif yum_proc.returncode == 0:
|
||||
run_yum_test(packages=package_files)
|
||||
package_manager = "yum"
|
||||
elif zypper_proc.returncode == 0:
|
||||
run_zypper_test(packages=package_files)
|
||||
package_manager = "zypper"
|
||||
else:
|
||||
logging.error("Found no supported package manager...Failing Test\n")
|
||||
sys.exit(1)
|
||||
if len(package_urls) == 0:
|
||||
logging.error("No packages to test... Failing test")
|
||||
return 1
|
||||
|
||||
test_args = get_test_args(package_manager, package_files)
|
||||
logging.info("Test Args:\n%s", json.dumps(test_args, sort_keys=True, indent=4))
|
||||
setup(test_args)
|
||||
install_fake_systemd(test_args)
|
||||
package_files = download_extract_all_packages(package_urls)
|
||||
|
||||
test_start()
|
||||
test_install_is_complete(test_args)
|
||||
test_ulimits_correct()
|
||||
test_restart()
|
||||
test_stop()
|
||||
test_install_compass(test_args)
|
||||
test_uninstall(test_args)
|
||||
test_uninstall_is_complete(test_args)
|
||||
package_manager = "" # type: str
|
||||
apt_proc = run_and_log("apt --help", end_on_error=False)
|
||||
yum_proc = run_and_log("yum --help", end_on_error=False)
|
||||
zypper_proc = run_and_log("zypper -n --help", end_on_error=False)
|
||||
# zypper
|
||||
if apt_proc.returncode == 0:
|
||||
run_apt_test(packages=package_files)
|
||||
package_manager = "apt"
|
||||
elif yum_proc.returncode == 0:
|
||||
run_yum_test(packages=package_files)
|
||||
package_manager = "yum"
|
||||
elif zypper_proc.returncode == 0:
|
||||
run_zypper_test(packages=package_files)
|
||||
package_manager = "zypper"
|
||||
else:
|
||||
logging.error("Found no supported package manager...Failing Test\n")
|
||||
return 1
|
||||
|
||||
sys.exit(0)
|
||||
test_args = get_test_args(package_manager, package_files)
|
||||
logging.info("Test Args:\n%s", json.dumps(test_args, sort_keys=True, indent=4))
|
||||
logging.info("Detected package kind: %s", test_args["package_kind"])
|
||||
|
||||
if test_args["package_kind"] == "server":
|
||||
setup(test_args)
|
||||
install_fake_systemd(test_args)
|
||||
test_start()
|
||||
|
||||
test_install_is_complete(test_args)
|
||||
|
||||
if test_args["package_kind"] == "server":
|
||||
test_ulimits_correct()
|
||||
test_restart()
|
||||
test_stop()
|
||||
test_install_compass(test_args)
|
||||
|
||||
test_uninstall(test_args)
|
||||
test_uninstall_is_complete(test_args)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
|
||||
72
buildscripts/tests/test_package_test_internal.py
Normal file
72
buildscripts/tests/test_package_test_internal.py
Normal file
@ -0,0 +1,72 @@
|
||||
import pathlib
|
||||
import unittest
|
||||
|
||||
from buildscripts import package_test_internal as under_test
|
||||
|
||||
|
||||
class PackageTestInternalHelpersTest(unittest.TestCase):
|
||||
def test_detects_server_package_sets(self):
|
||||
package_names = [
|
||||
"mongodb-enterprise-unstable",
|
||||
"mongodb-enterprise-unstable-server",
|
||||
"mongodb-enterprise-unstable-mongos",
|
||||
"mongodb-database-tools",
|
||||
"mongodb-mongosh",
|
||||
]
|
||||
|
||||
self.assertEqual("server", under_test.get_package_kind(package_names))
|
||||
|
||||
def test_detects_crypt_v1_package_sets(self):
|
||||
package_names = [
|
||||
"mongodb-enterprise-unstable-crypt-v1",
|
||||
"mongodb-database-tools",
|
||||
"mongodb-mongosh",
|
||||
]
|
||||
|
||||
self.assertEqual("crypt_v1", under_test.get_package_kind(package_names))
|
||||
|
||||
def test_unknown_package_set_raises(self):
|
||||
with self.assertRaises(RuntimeError):
|
||||
under_test.get_package_kind(["mongodb-database-tools", "mongodb-mongosh"])
|
||||
|
||||
def test_server_required_files_include_mongod_service(self):
|
||||
test_args = {
|
||||
"package_kind": "server",
|
||||
"systemd_units_dir": "/usr/lib/systemd/system",
|
||||
}
|
||||
|
||||
self.assertEqual(
|
||||
[
|
||||
pathlib.Path("/etc/mongod.conf"),
|
||||
pathlib.Path("/usr/bin/mongod"),
|
||||
pathlib.Path("/var/log/mongodb/mongod.log"),
|
||||
pathlib.Path("/usr/lib/systemd/system/mongod.service"),
|
||||
],
|
||||
under_test.get_required_files(test_args),
|
||||
)
|
||||
|
||||
def test_crypt_v1_required_files_follow_libdir(self):
|
||||
test_args = {
|
||||
"package_kind": "crypt_v1",
|
||||
"lib_dir": "/usr/lib64",
|
||||
}
|
||||
|
||||
self.assertEqual(
|
||||
[
|
||||
pathlib.Path("/usr/include/mongo_crypt/v1/mongo_crypt/mongo_crypt.h"),
|
||||
pathlib.Path("/usr/lib64/mongo_crypt_v1.so"),
|
||||
],
|
||||
under_test.get_required_files(test_args),
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
[
|
||||
pathlib.Path("/usr/include/mongo_crypt/v1/mongo_crypt/mongo_crypt.h"),
|
||||
pathlib.Path("/usr/lib64/mongo_crypt_v1.so"),
|
||||
],
|
||||
under_test.get_leftover_files(test_args),
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@ -2700,6 +2700,37 @@ functions:
|
||||
- "unused-url-placeholder"
|
||||
- "--evg-build-id"
|
||||
- "${build_id}"
|
||||
- "--evg-package-task-name"
|
||||
- "${package_task_name|package}"
|
||||
- "--edition"
|
||||
- "${repo_edition}"
|
||||
- "--server-version"
|
||||
- "${version}"
|
||||
|
||||
"run crypt package test":
|
||||
- *get_version_expansions
|
||||
- *apply_version_expansions
|
||||
- *f_expansions_write
|
||||
- *configure_evergreen_api_credentials
|
||||
- command: subprocess.exec
|
||||
display_name: "crypt package test py"
|
||||
type: test
|
||||
params:
|
||||
binary: bash
|
||||
add_expansions_to_env: true
|
||||
args:
|
||||
- "src/evergreen/run_python_script.sh"
|
||||
- "buildscripts/package_test.py"
|
||||
- "--skip-enterprise-check"
|
||||
- "--arch=${packager_arch}"
|
||||
- "branch"
|
||||
- "--test"
|
||||
- "${packager_distro}"
|
||||
- "unused-url-placeholder"
|
||||
- "--evg-build-id"
|
||||
- "${build_id}"
|
||||
- "--evg-package-task-name"
|
||||
- "${package_task_name|crypt_lib_package}"
|
||||
- "--edition"
|
||||
- "${repo_edition}"
|
||||
- "--server-version"
|
||||
|
||||
@ -1838,6 +1838,23 @@ tasks:
|
||||
docker_username: ${dockerhub_username}
|
||||
docker_password: ${dockerhub_password}
|
||||
|
||||
- name: test_crypt_packages
|
||||
tags: ["assigned_to_jira_team_devprod_correctness", "auxiliary"]
|
||||
depends_on:
|
||||
- name: crypt_lib_package
|
||||
commands:
|
||||
- command: manifest.load
|
||||
- func: "git get project and add git tag"
|
||||
- func: "f_expansions_write"
|
||||
- func: "kill processes"
|
||||
- func: "cleanup environment"
|
||||
- func: "set up venv"
|
||||
- func: "run crypt package test"
|
||||
vars:
|
||||
docker_username: ${dockerhub_username}
|
||||
docker_password: ${dockerhub_password}
|
||||
package_task_name: crypt_lib_package
|
||||
|
||||
- name: test_packages_release
|
||||
tags: ["assigned_to_jira_team_devprod_correctness", "auxiliary"]
|
||||
depends_on:
|
||||
|
||||
@ -94,6 +94,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
@ -238,6 +241,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-4xlarge
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-4xlarge
|
||||
- name: full_bazel_compiledb
|
||||
cron: "0 4 * * 0" # From the ${project_weekly_cron} parameter.
|
||||
distros:
|
||||
|
||||
@ -98,6 +98,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: .development_critical !.requires_large_host !.incompatible_debian !.incompatible_oscrypto
|
||||
- name: .development_critical .requires_large_host !.incompatible_debian !.incompatible_oscrypto
|
||||
distros:
|
||||
|
||||
@ -132,6 +132,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: selinux_rhel8_enterprise
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
@ -232,6 +235,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-xlarge
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-xlarge
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
@ -333,6 +339,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: selinux_rhel9_enterprise
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
@ -432,6 +441,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-xlarge
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-xlarge
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
@ -534,6 +546,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: selinux_rhel10_enterprise
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
@ -635,6 +650,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-small
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-small
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
|
||||
@ -47,6 +47,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
|
||||
@ -224,6 +224,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
@ -290,6 +293,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-large
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
@ -386,6 +392,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-xlarge
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-xlarge
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
@ -489,6 +498,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-4xlarge
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2204-arm64-m8g-4xlarge
|
||||
- name: .development_critical !.requires_large_host
|
||||
- name: .development_critical .requires_large_host
|
||||
distros:
|
||||
@ -594,6 +606,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2404-large
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2404-large
|
||||
- name: test_packages_release
|
||||
distros:
|
||||
- rhel94-large-packagetest
|
||||
@ -698,6 +713,9 @@ buildvariants:
|
||||
- name: test_packages
|
||||
distros:
|
||||
- ubuntu2404-arm64-m8g-2xlarge
|
||||
- name: test_crypt_packages
|
||||
distros:
|
||||
- ubuntu2404-arm64-m8g-2xlarge
|
||||
- name: test_packages_release
|
||||
distros:
|
||||
- rhel94-arm64-m8g-4xlarge-packagetest
|
||||
|
||||
Loading…
Reference in New Issue
Block a user