On Wed, May 14, 2025 at 9:16 AM Dumitru Ceara <dce...@redhat.com> wrote:
> On 5/14/25 7:37 AM, Ales Musil wrote: > > This is OVN adaptation of OvS patch: > > > > On two separate occasions GitHub added random garbage into the hosts > > file breaking our tests. This change adds a permanent workaround for > > this kind of stuff. It will remove everything that doesn't look like > > a correct syntax from the file. > > > > The regex is not perfect, but it should be sufficient for most cases. > > It allows empty lines, comments and a valid 'IP NAME[ NAME]...' lines, > > where 'IP' resembles an IP address and the 'NAME' consists of valid > > DNS characters. Under normal conditions the diff should always be > > empty. > > > > Co-authored-by: Ilya Maximets <i.maxim...@ovn.org> > > Signed-off-by: Ilya Maximets <i.maxim...@ovn.org> > > Signed-off-by: Ales Musil <amu...@redhat.com> > > --- > > v2: Add the fix everywhere. > > --- > > Hi Ales, > > > .ci/linux-util.sh | 10 ++++++++++ > > .github/workflows/containers.yml | 5 +++++ > > .github/workflows/ovn-fake-multinode-tests.yml | 11 +++++++++++ > > .github/workflows/ovn-kubernetes.yml | 10 ++++++++++ > > .github/workflows/test.yml | 15 +++++++++++++++ > > 5 files changed, 51 insertions(+) > > > > diff --git a/.ci/linux-util.sh b/.ci/linux-util.sh > > index a4802ff2d..c683ef345 100755 > > --- a/.ci/linux-util.sh > > +++ b/.ci/linux-util.sh > > @@ -25,3 +25,13 @@ function set_containers_apparmor_profile() > > sed -i "s/^#apparmor_profile = \".*\"$/apparmor_profile = > \"$profile\"/" \ > > /usr/share/containers/containers.conf > > } > > + > > Nit: I'd add a comment about why we need to fix /etc/hosts. Something > like Ilya added in the OVS commit: > > > https://github.com/openvswitch/ovs/blob/1b2eff486f30a4c78e6a936c6f81cd4961b58f8f/.github/workflows/build-and-test.yml#L283-L287 > > > > +function fix_etc_hosts() > > +{ > > + cp /etc/hosts ./hosts.bak > > + sed -E -n \ > > + > '/^[[:space:]]*(#.*|[0-9a-fA-F:.]+([[:space:]]+[a-zA-Z0-9.-]+)+|)$/p' \ > > + ./hosts.bak | sudo tee /etc/hosts > > + > > + diff -u ./hosts.bak /etc/hosts || true > > +} > > With that addressed: > Acked-by: Dumitru Ceara <dce...@redhat.com> > > Regards, > Dumitru > > Thank you Dumitru, I went ahead and merged it into main and backported all the way down to 24.03. Regards, Ales _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev