summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-01-04 12:07:28 +0100
committerGitHub <noreply@github.com>2025-01-04 12:07:28 +0100
commit9a5f14b2e98b6efb90798c70c37db5a8df11b368 (patch)
tree3a3fd6a48d44e9ee51a6dd895d6ff84333a4a7ff /smoketest/scripts
parentbb4611544ff73a979f927a7a1c8ea3dd1c56fb48 (diff)
parent20842f57383258910009222d4588e635e5a9042e (diff)
downloadvyos-1x-9a5f14b2e98b6efb90798c70c37db5a8df11b368.tar.gz
vyos-1x-9a5f14b2e98b6efb90798c70c37db5a8df11b368.zip
Merge pull request #4271 from nvollmar/T6994
T6994: Add textfile collector config option
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_service_monitoring_prometheus.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_service_monitoring_prometheus.py b/smoketest/scripts/cli/test_service_monitoring_prometheus.py
index df737f840..6e7f8c808 100755
--- a/smoketest/scripts/cli/test_service_monitoring_prometheus.py
+++ b/smoketest/scripts/cli/test_service_monitoring_prometheus.py
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import os
import unittest
from base_vyostest_shim import VyOSUnitTestSHIM
@@ -55,6 +56,7 @@ class TestMonitoringPrometheus(VyOSUnitTestSHIM.TestCase):
def test_01_node_exporter(self):
self.cli_set(base_path + ['node-exporter', 'listen-address', listen_ip])
+ self.cli_set(base_path + ['node-exporter', 'collectors', 'textfile'])
# commit changes
self.cli_commit()
@@ -62,6 +64,11 @@ class TestMonitoringPrometheus(VyOSUnitTestSHIM.TestCase):
file_content = read_file(node_exporter_service_file)
self.assertIn(f'{listen_ip}:9100', file_content)
+ self.assertTrue(os.path.isdir('/run/node_exporter/collector'))
+ self.assertIn(
+ '--collector.textfile.directory=/run/node_exporter/collector', file_content
+ )
+
# Check for running process
self.assertTrue(process_named_running(NODE_EXPORTER_PROCESS_NAME))