From 716a3bcdd934643b67d6c89f0ad81e208a522a56 Mon Sep 17 00:00:00 2001 From: Eugene Zamriy Date: Sat, 25 Mar 2023 21:57:53 +0300 Subject: [PATCH] Implemented connectivity checking via MSVSphere infrastructure --- SOURCES/20-connectivity-msvsphere.conf | 10 +++++++ SPECS/NetworkManager.spec | 41 ++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 SOURCES/20-connectivity-msvsphere.conf diff --git a/SOURCES/20-connectivity-msvsphere.conf b/SOURCES/20-connectivity-msvsphere.conf new file mode 100644 index 0000000..04cc3e5 --- /dev/null +++ b/SOURCES/20-connectivity-msvsphere.conf @@ -0,0 +1,10 @@ +# Enable connectivity checking for NetworkManager. +# See `man NetworkManager.conf`. +# +# Note that connectivity checking works badly with rp_filter set to +# strict. Check "/proc/sys/net/ipv4/conf/*/rp_filter". +[connectivity] +enabled=true +uri=http://static.inferitos.ru/test/check-networkmanager.txt +response=OK +interval=300 diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index 5bd7ff0..5d095a3 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -71,11 +71,16 @@ %else %bcond_with connectivity_fedora %endif +%if 0%{?msvsphere} && 0%{?msvsphere} >= 8 +%bcond_without connectivity_msvsphere +%else +%bcond_with connectivity_msvsphere %if 0%{?rhel} && 0%{?rhel} >= 8 %bcond_without connectivity_redhat %else %bcond_with connectivity_redhat %endif +%endif # end of MSVSphere block %if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 %bcond_without crypto_gnutls %else @@ -174,7 +179,7 @@ Name: NetworkManager Summary: Network connection manager and user applications Epoch: %{epoch_version} Version: %{rpm_version} -Release: %{release_version}%{?snap}%{?dist} +Release: %{release_version}%{?snap}%{?dist}.inferit Group: System Environment/Base License: GPLv2+ and LGPLv2+ URL: https://networkmanager.dev/ @@ -187,6 +192,9 @@ Source5: 20-connectivity-redhat.conf Source6: 70-nm-connectivity.conf Source7: readme-ifcfg-rh.txt +# MSVSphere sources +Source1000: 20-connectivity-msvsphere.conf + # RHEL downstream patches that change behavior from upstream. # These are not bugfixes, hence they are also relevant after # the next rebase of the source tarball. @@ -510,6 +518,18 @@ This adds a NetworkManager configuration file to enable connectivity checking via Red Hat infrastructure. %endif +%if %{with connectivity_msvsphere} +%package config-connectivity-msvsphere +Summary: NetworkManager config file for connectivity checking via MSVSphere servers +Group: System Environment/Base +BuildArch: noarch +Provides: NetworkManager-config-connectivity = %{epoch}:%{version}-%{release} + +%description config-connectivity-msvsphere +This adds a NetworkManager configuration file to enable connectivity checking +via MSVSphere infrastructure. +%endif + %package config-server Summary: NetworkManager config file for "server-like" defaults @@ -893,6 +913,12 @@ mkdir -p %{buildroot}%{_sysctldir} cp %{SOURCE6} %{buildroot}%{_sysctldir} %endif +%if %{with connectivity_msvsphere} +cp %{SOURCE1000} %{buildroot}%{nmlibdir}/conf.d/ +mkdir -p %{buildroot}%{_sysctldir} +cp %{SOURCE6} %{buildroot}%{_sysctldir} +%endif + %if 0%{?ifcfg_warning} cp %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/network-scripts %endif @@ -1180,6 +1206,14 @@ fi %{_sysctldir}/70-nm-connectivity.conf %endif +%if %{with connectivity_msvsphere} +%files config-connectivity-msvsphere +%dir %{nmlibdir} +%dir %{nmlibdir}/conf.d +%{nmlibdir}/conf.d/20-connectivity-msvsphere.conf +%{_sysctldir}/70-nm-connectivity.conf +%endif + %files config-server %dir %{nmlibdir} @@ -1229,8 +1263,9 @@ fi %changelog -* Wed Mar 15 2023 MSVSphere Packaging Team - 1.40.0-1 -- Rebuilt for MSVSphere 9.1. +* Wed Mar 15 2023 Eugene Zamriy - 1:1.40.0-1.inferit +- Implemented connectivity checking via MSVSphere infrastructure +- Rebuilt for MSVSphere 9.1 * Fri Aug 26 2022 Ana Cabral - 1:1.40.0-1 - Update to 1.40.0 release