Skip to content

Commit

Permalink
Add DNS entries to hosts files on github workflows (#4776) (#4809)
Browse files Browse the repository at this point in the history
* Refs #20652. Write hosts file on reusable-ubuntu-ci.

Signed-off-by: Miguel Company <[email protected]>

* Refs #20652. Write hosts file on reusable-sanitizers-ci.

Signed-off-by: Miguel Company <[email protected]>

* Refs #20652. Write hosts file on reusable-mac-ci.

Signed-off-by: Miguel Company <[email protected]>

* Refs #20652. Apply review suggestions.

Signed-off-by: Miguel Company <[email protected]>

---------

Signed-off-by: Miguel Company <[email protected]>
(cherry picked from commit 625b041)

Co-authored-by: Miguel Company <[email protected]>
  • Loading branch information
mergify[bot] and MiguelCompany authored May 23, 2024
1 parent a904d84 commit db3d420
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/reusable-mac-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,18 @@ jobs:
- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0

# TODO(eduponz): Update known hosts file for DNS resolver testing. NOTE: The runner cannot modify /etc/hosts.
- name: Set up hosts file for DNS testing
run: |
sudo echo "" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "::1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "154.56.134.194 www.eprosima.com.test" | sudo tee -a /etc/hosts
sudo echo "216.58.215.164 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "2a00:1450:400e:803::2004 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.4 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.3 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "ff1e::ffff:efff:1 acme.org.test" | sudo tee -a /etc/hosts
# TODO(eduponz): Set up libp11 and SoftHSM. NOTE: using SoftHSM requires adding the runner to a group,
# which entails logout/login or rebooting the machine. This is not feasible in a CI environment.

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/reusable-sanitizers-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ jobs:
with:
packages: vcstool setuptools gcovr tomark xmltodict jsondiff pandas

- name: Set up hosts file for DNS testing
run: |
sudo echo "" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "::1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "154.56.134.194 www.eprosima.com.test" | sudo tee -a /etc/hosts
sudo echo "216.58.215.164 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "2a00:1450:400e:803::2004 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.4 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.3 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "ff1e::ffff:efff:1 acme.org.test" | sudo tee -a /etc/hosts
- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0

Expand Down Expand Up @@ -363,6 +375,18 @@ jobs:
destination_workspace: src
skip_existing: 'true'

- name: Set up hosts file for DNS testing
run: |
sudo echo "" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "::1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "154.56.134.194 www.eprosima.com.test" | sudo tee -a /etc/hosts
sudo echo "216.58.215.164 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "2a00:1450:400e:803::2004 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.4 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.3 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "ff1e::ffff:efff:1 acme.org.test" | sudo tee -a /etc/hosts
- name: Fetch Fast DDS CI dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/reusable-ubuntu-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,18 @@ jobs:
- name: Setup CCache
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0

# TODO(eduponz): Update known hosts file for DNS resolver testing. NOTE: The runner cannot modify /etc/hosts.
- name: Set up hosts file for DNS testing
run: |
sudo echo "" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "::1 localhost.test" | sudo tee -a /etc/hosts
sudo echo "154.56.134.194 www.eprosima.com.test" | sudo tee -a /etc/hosts
sudo echo "216.58.215.164 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "2a00:1450:400e:803::2004 www.acme.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.4 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "140.82.121.3 www.foo.com.test" | sudo tee -a /etc/hosts
sudo echo "ff1e::ffff:efff:1 acme.org.test" | sudo tee -a /etc/hosts
# TODO(eduponz): Set up libp11 and SoftHSM. NOTE: using SoftHSM requires adding the runner to a group,
# which entails logout/login or rebooting the machine. This is not feasible in a CI environment.

Expand Down

0 comments on commit db3d420

Please sign in to comment.