summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorNicolas Vollmar <nvollmar@gmail.com>2025-01-02 14:51:42 +0100
committerNicolas Vollmar <nvollmar@gmail.com>2025-01-02 16:30:20 +0100
commit20842f57383258910009222d4588e635e5a9042e (patch)
tree7063a1ad1abecf8f15c6c149c97758cbfab7c467 /smoketest
parent825743b6bcdf8fa2c263dabaa3fee40ba7a98525 (diff)
downloadvyos-1x-20842f57383258910009222d4588e635e5a9042e.tar.gz
vyos-1x-20842f57383258910009222d4588e635e5a9042e.zip
T6994: Add textfile collector config option
Diffstat (limited to 'smoketest')
-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))