mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
Document running integration tests with podman
Document how to run integration test with podman, and list the files that are currently not working with podman. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
parent
d2bd928278
commit
eda49e3b38
1 changed files with 58 additions and 0 deletions
|
|
@ -289,6 +289,64 @@ ansible-playbook --skip-tags tests::cleanup \
|
|||
-i testhost, tests/playbooks/tests_802_1x.yml
|
||||
```
|
||||
|
||||
### Integration tests with podman
|
||||
1. Create `~/.ansible/collections/ansible_collections/containers/podman/` if this
|
||||
directory does not exist and `cd` into this directory.
|
||||
```bash
|
||||
mkdir -p ~/.ansible/collections/ansible_collections/containers/podman/
|
||||
cd ~/.ansible/collections/ansible_collections/containers/podman/
|
||||
```
|
||||
|
||||
2. Clone the collection plugins for Ansible-Podman into the current directory.
|
||||
```bash
|
||||
git clone https://github.com/containers/ansible-podman-collections.git .
|
||||
```
|
||||
|
||||
3. Change directory into the `network/tests`, `network` is the Repo you cloned from
|
||||
your local fork.
|
||||
```bash
|
||||
cd ~/network/tests
|
||||
```
|
||||
|
||||
|
||||
4. Use podman with `-d` to run in the background (daemon). Use `c7` because
|
||||
`centos/systemd` is centos7.
|
||||
```bash
|
||||
podman run --name c7 --rm --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -d registry.centos.org/centos/systemd
|
||||
```
|
||||
|
||||
5. Use `podman unshare` first to run "podman mount" in root mode, use `-vi` to run
|
||||
ansible as inventory in verbose mode, use `-c podman` to use collection plugins. Note,
|
||||
the following tests are currently not working with podman:
|
||||
- `tests_802_1x_nm.yml`
|
||||
- `tests_802_1x_updated_nm.yml`
|
||||
- `tests_bond_initscripts.yml`
|
||||
- `tests_bond_nm.yml`
|
||||
- `tests_bridge_initscripts.yml`
|
||||
- `tests_bridge_nm.yml`
|
||||
- `tests_default_nm.yml`
|
||||
- `tests_ethernet_nm.yml`
|
||||
- `tests_reapply_nm.yml`
|
||||
- `tests_states_nm.yml`
|
||||
- `tests_vlan_mtu_initscripts.yml`
|
||||
- `tests_vlan_mtu_nm.yml`
|
||||
- `tests_wireless_nm.yml`
|
||||
|
||||
```bash
|
||||
podman unshare
|
||||
ansible-playbook -vi c7, -c podman tests_provider_nm.yml
|
||||
```
|
||||
|
||||
6. NOTE that this leaves the container running in the background, to kill it:
|
||||
```bash
|
||||
> podman ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
02a45f9d53df registry.centos.org/centos/systemd:latest /usr/sbin/init 13 minutes ago Up 13 minutes ago c7
|
||||
> podman stop 02a45f9d53df
|
||||
> podman rm 02a45f9d53df
|
||||
```
|
||||
|
||||
|
||||
### Continuous integration
|
||||
|
||||
The [continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) (CI)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue