Aller au contenu
Skillpedia
Déploiement et cloud (DevOps)5.4k · #14964

azldev-mock

Ce qu’il fait

Cette compétence montre comment exécuter des paquets et inspecter les fichiers RPM dans un chroot mock avec azldev. Elle s'adresse aux développeurs qui veulent vérifier en toute sécurité les paquets compilés avant leur livraison.

Quand l’utiliser

  • ✓Quand vous avez compilé un RPM et voulez le tester sans l'installer sur votre ordinateur.
  • ✓Quand un RPM ne s'installe pas et que vous voulez voir le détail des erreurs.
  • ✓Quand vous devez vérifier la liste des fichiers ou les dépendances d'un paquet compilé.

Lien du skill

https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-mock/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/microsoft/azurelinux/blob/4.0/.agents/skills/azldev-mock/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“J'ai compilé un RPM pour mon paquet. Peux-tu le tester dans un chroot mock et vérifier sa liste de fichiers et ses dépendances ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent exécute des commandes dans un shell mock grâce à une saisie non interactive, lit les informations du paquet et relance l'installation dans l'environnement isolé. Rien n'est installé sur la machine hôte.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Test and inspect packages in a mock chroot

Never install built RPMs on the host. They target the distro you are building, not your dev machine. Use a mock chroot instead.

azldev tests and inspects packages inside mock build roots via mock shell, which lives under the hidden advanced group (azldev adv is an alias for azldev advanced; it does not appear in azldev --help).

Non-interactive chroot (preferred for agents)

Pipe commands in via a heredoc — fully autonomous, no user interaction needed:

azldev adv mock shell --add-package /path/to/package.rpm <<'CMDS'
<command> --version
echo "exit code: $?"
exit
CMDS

Use this for automated checks: running binaries, querying installed packages, inspecting paths.

Inspect an RPM without installing it

When --add-package fails to install, or you just want to look at an RPM's contents, get the file inside the chroot and inspect it there rather than installing on the host. If the RPM is not already reachable inside the build root, copy it in first with mock --copyin <rpm> /tmp/ (using the project's distro mock config), then:

azldev adv mock shell <<'CMDS'
rpm -qip /tmp/<name>*.rpm    # package info
rpm -qlp /tmp/<name>*.rpm    # file list
rpm -qRp /tmp/<name>*.rpm    # dependencies
dnf install /tmp/<name>*.rpm # retry the install to see the error details
exit
CMDS

This gives you the full distro environment for debugging dependency issues, file conflicts, and failed installs, without touching the host.

Interactive chroot

Use when you need to explore interactively or react to output between commands:

azldev adv mock shell --add-package /path/to/package.rpm --enable-network

When driving an interactive shell as an agent:

  1. Run a simple command (e.g. echo ready) in a foreground terminal to establish a shared shell.
  2. Ask the user to run the azldev adv mock shell command in that same terminal.
  3. Wait for confirmation that they are inside the mock shell.
  4. Run diagnostic commands in the same foreground terminal — they execute inside the chroot.
  5. Run exit to leave the chroot.

Prefer the non-interactive heredoc approach; use interactive only when you must react to output between commands.

Key flags

Flag Purpose
-p, --add-package <path> Install a package into the chroot before entering. Accepts an RPM file path or a package name. May be repeated.
--enable-network Allow network access (dependency resolution, downloads).

-p means --add-package, not a component name. Unlike azldev comp build -p <name>, mock shell has no component selector. -p <name> installs a package by name from the configured repos — it does not set up a chroot with that component's build dependencies.

Gotchas

  • Don't mix -p <name> with --add-package /path/to/<name>.rpm for the same package — that installs both the repo build and your local build, which conflict. Use one or the other.
  • The mock chroot is persistent across azldev adv mock shell sessions — installed packages and created files survive. Handy (install once, re-enter later), but stale state can confuse. azldev has no built-in reset; clear it with mock directly (--scrub=chroot, or --scrub=all to also drop the bootstrap), pointing at the project's distro mock config.
  • One mock session per terminal. Running azldev adv mock shell while a terminal is already inside a mock shell fails — run exit first.

Generated by azldev docs agent; do not hand-edit.

Questions fréquentes

Pourquoi ne pas installer les RPM sur mon ordinateur ?

La compétence indique que les paquets compilés visent la distribution en cours de compilation, et non votre propre machine.

Peut-il fonctionner sans étapes manuelles ?

Oui. La compétence décrit une façon non interactive d'envoyer des commandes au shell.

Faut-il une commande particulière ?

Elle utilise la commande avancée de shell mock, qui n'apparaît pas dans l'aide standard.

Détails

Description originale de l’auteur

Read this before testing or inspecting a built RPM; do not drive mock by hand from memory. Explains how to test and inspect built packages in a mock chroot with 'azldev adv mock shell', covering non-interactive (heredoc) and interactive chroot workflows, the -p/--add-package flag, and resetting stale chroot state. Triggers include test package, mock shell, inspect rpm, smoke test, chroot, verify build output.

repo: microsoft/azurelinux

Popularité

Étoiles GitHub
5.4k
Position au classement
#14964
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires