diff --git a/dogen/templates/template.jinja b/dogen/templates/template.jinja
index 84e3c4c..170fd59 100644
--- a/dogen/templates/template.jinja
+++ b/dogen/templates/template.jinja
@@ -63,9 +63,10 @@ COPY repos/*.repo /etc/yum.repos.d/
 COPY *.rpm /tmp/rpms/
 {% endif %}
 
-# Install required RPMs
+# Install required RPMs and ensure that the packages were installed
 RUN yum install -y {% if additional_repos -%} --disablerepo=\* {%- for repo in additional_repos %} --enablerepo={{ repo }}{% endfor %}{% endif %} {%- for package in packages %} {{ package }}{% endfor %} {%- for rpm in rpms %} /tmp/rpms/{{ rpm }} {% endfor %} \
-    && yum clean all
+    && yum clean all && \
+    rpm -q {% for package in packages %} {{ package }}{% endfor %}
 
 {% if additional_repos %}
 # Remove custom repo files

force a failure if a package installation fails
Yum has some annoying behaviour, if you perform `yum install foo bar baz` and at least one package exists/succeeds, then it will return success. This masks some error conditions: missing package, possible missing repos files etc.

We should generate some additional CMDs to ensure that we bail out if a package does not exist or install.
diff --git a/tests/test_package.py b/tests/test_package.py
new file mode 100644
index 0000000..b742e65
--- /dev/null
+++ b/tests/test_package.py
@@ -0,0 +1,50 @@
+import argparse
+import mock
+import os
+import tempfile
+import unittest
+import shutil
+import re
+import sys
+
+from dogen.plugins.repo import Repo
+from dogen.generator import Generator
+
+class TestPackage(unittest.TestCase):
+    def setUp(self):
+        self.workdir = tempfile.mkdtemp(prefix='test_repo_plugin')
+        self.descriptor = tempfile.NamedTemporaryFile(delete=False)
+        self.target_dir = os.path.join(self.workdir, "target")
+        self.log = mock.Mock()
+
+    def teardown(self):
+        shutil.rmtree(self.workdir)
+
+    def write_config(self, config):
+        with self.descriptor as f:
+            f.write(config.encode())
+
+    def prepare_dogen(self, repo_files_dir=None):
+        args = argparse.Namespace(path=self.descriptor.name, output=self.target_dir, without_sources=None,
+                                  template=None, scripts_path=None, additional_script=None,
+                                  skip_ssl_verification=None, repo_files_dir=repo_files_dir)
+        self.dogen = Generator(self.log, args, [Repo])
+
+    def test_custom_repo_files_should_add_two(self):
+        open(os.path.join(self.workdir, "fedora.repo"), 'a').close()
+        open(os.path.join(self.workdir, "test.repo"), 'a').close()
+
+        self.write_config("release: '1'\nversion: '1'\ncmd:\n - whoami\nfrom: scratch\nname: someimage\npackages:\n - wget")
+        self.prepare_dogen(self.workdir)
+        self.dogen.run()
+
+        self.assertIsNotNone(self.dogen.cfg)
+        self.assertIsNotNone(self.dogen.cfg.get('packages'))
+        self.assertIsInstance(self.dogen.cfg.get('packages'), list)
+        self.assertIn("wget", self.dogen.cfg.get('packages'))
+
+        dockerfile = open(os.path.join(self.target_dir, "Dockerfile")).read()
+
+        sys.stderr.write("\t\t\tDEBUGDEBUG\n{}\n".format(dockerfile))
+        self.assertTrue(re.match(r'.*yum install[^\n]+wget', dockerfile, re.DOTALL))
+        self.assertTrue(re.match(r'.*rpm -q +wget', dockerfile, re.DOTALL))

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov mock
apt-get update apt-get install -y gcc
3.9
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi==2025.1.31
charset-normalizer==3.4.1
coverage==7.8.0
docopt==0.6.2
-e git+https://github.com/jboss-dockerfiles/dogen.git@472aa64387e01f6fa7bc529fd8b9f5fc12b5dee7#egg=dogen
exceptiongroup==1.2.2
idna==3.10
iniconfig==2.1.0
Jinja2==3.1.6
MarkupSafe==3.0.2
mock==5.2.0
packaging==24.2
pluggy==1.5.0
pykwalify==1.8.0
pytest==8.3.5
pytest-cov==6.0.0
python-dateutil==2.9.0.post0
PyYAML==6.0.2
requests==2.32.3
ruamel.yaml==0.18.10
ruamel.yaml.clib==0.2.12
six==1.17.0
tomli==2.2.1
urllib3==2.3.0

name: dogen
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - coverage==7.8.0
      - docopt==0.6.2
      - exceptiongroup==1.2.2
      - idna==3.10
      - iniconfig==2.1.0
      - jinja2==3.1.6
      - markupsafe==3.0.2
      - mock==5.2.0
      - packaging==24.2
      - pluggy==1.5.0
      - pykwalify==1.8.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.2
      - requests==2.32.3
      - ruamel-yaml==0.18.10
      - ruamel-yaml-clib==0.2.12
      - six==1.17.0
      - tomli==2.2.1
      - urllib3==2.3.0
prefix: /opt/conda/envs/dogen

tests/test_package.py::TestPackage::test_custom_repo_files_should_add_two
dogen/templates/template.jinja
dogen/templates/template.jinja