自动测试复杂RPM集的依赖关系

发布于 2024-09-15 18:47:18 字数 889 浏览 10 评论 0原文

我有一套大约 150 个自定义 RPM 的软件套件,它们之间具有相当复杂的依赖关系:

  • 每个包的依赖关系树通常大约有五个级别深,
  • 有几个包(故意)相互冲突,
  • 大多数包依赖于一个或多个Red Hat 软件包以及其他自定义软件包

我的持续集成机器构建我的所有软件包并从中创建一个 yum 存储库,然后旋转 yum 存储库的 ISO - 这就是我的软件的分发方式。

我的问题:我希望 CI 机器验证 ISO 中的每个包,其所有依赖项是否由 ISO 中的其他自定义包或 Red Hat 包满足。这样做的目的不仅是捕获底层软件中的错误,还包括那些忘记将更改推送到源代码管理中的发布分支的开发人员。

我想解决这个问题的方法如下(这样你们就可以告诉我有更好的方法!):对于每个软件包,创建一个干净的虚拟机,其中:

  • 基本安装 RHEL 或 CentOS
  • 软件包存储库,指向 RHEL 镜像和我的ISO(通过循环设备安装)

...并在虚拟机中调用“yum install xxx”。

问题是,这需要太长时间 - 每个软件包安装都会修改虚拟机的状态。每个 RPM 确实需要在“干净”的操作系统上进行测试,并且每个包的重新创建大约需要 10 分钟。我可以在不修改虚拟机或每次从头开始重新创建虚拟机的情况下测试我的软件包安装吗?我希望 yum 有一个“--test”命令行参数,与“rpm -i --test”类似,但我没有看到。我不能直接使用“rpm”,因为它不会自动下载依赖项。

问题:

  • 有谁知道在“模拟”模式下运行 yum 的方法吗?
  • 有更好的方法来解决我的问题吗?

请记住,我使用的是 RHEL(yum 3.2.22),而不是 Fedora,但 EPEL 可能可以使用。

I have a software suite of ~150 custom RPMs, with fairly complex dependencies between them:

  • the tree of dependencies for each package is usually about five levels deep
  • there are several packages that (deliberately) conflict with one another
  • most packages depend on one or more Red Hat packages as well as other custom packages

My Continuous Integration machine builds all my packages and creates a yum repository from them, and then spins an ISO of the yum repo - which is how my software is distributed.

My problem: I'd like the CI machine to verify, for every package in the ISO, that all its dependencies are met either by other custom packages in the ISO, or by Red Hat packages. This is intended to trap not only bugs in the underlying software but also developers who have forgotten to push their changes to the release branch in source control.

Here's how I'd like to solve it (so you guys can tell me there's a better way!): for each package, create a clean virtual machine with:

  • a basic install of RHEL or CentOS
  • package repos pointing at a RHEL mirror and my ISO (mounted via loop device)

...and call "yum install xxx" in the Virtual Machine.

The trouble is, this takes too long - doing each package install modifies the state of the Virtual Machine. Each RPM really needs to be tested on a "clean" OS, and recreating that takes ~10 minutes per package. Can I test my package install without modifying the VM or recreating the VM from scratch every time? I was hoping there was a "--test" command line argument to yum in a similar way to "rpm -i --test", but I don't see one. I can't use "rpm" directly because it doesn't automatically download dependencies.

The questions:

  • does anyone know of a way to run yum in "simulated" mode?
  • is there a better way to solve my problem?

Bear in mind I'm on RHEL here (yum 3.2.22), not Fedora, but EPEL is probably all right to use.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月静好 2024-09-22 18:47:18

您几乎描述了 OSB: https://build.opensuse.org/

它不是特定于发行版的,您也许能够让它为您工作,而不会带来太多麻烦。

You pretty much described the OSB: https://build.opensuse.org/

It is not distro specific, you might be able to make it work for you w/o too much hassle.

划一舟意中人 2024-09-22 18:47:18

你可以使用我写的一个名为 mach 的工具。它为发行版设置 chroot。您可以

  • 设置基本的 chroot
  • mach -r (您的 root) yum install 'rpm 1'
  • mach -r (您的 root) 安装基础 (这将卸载所有已安装的 rpm)
  • mach -r (您的 root) yum install 'rpm 2'

这比在虚拟机上执行要快。

You could use a tool I wrote called mach. It sets up a chroot for a distribution. You could

  • set up the basic chroot
  • mach -r (your root) yum install 'rpm 1'
  • mach -r (your root) setup base (which will uninstall all installed rpms)
  • mach -r (your root) yum install 'rpm 2'

It would be faster than doing it on a vm.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文