aboutsummaryrefslogtreecommitdiff
path: root/rrd/tests/test_datasources.py
diff options
context:
space:
mode:
Diffstat (limited to 'rrd/tests/test_datasources.py')
-rw-r--r--rrd/tests/test_datasources.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/rrd/tests/test_datasources.py b/rrd/tests/test_datasources.py
index 4057b14..030d0ae 100644
--- a/rrd/tests/test_datasources.py
+++ b/rrd/tests/test_datasources.py
@@ -50,3 +50,11 @@ class TestDataSource(TestCase):
last = ds.lastupdate
self.assertEqual(last[1], 10)
self.assertEqual(last[0].year, now.year)
+
+ def test_invalid_path(self):
+ ds = models.DataSource.objects.create(
+ topic="evil",
+ path="../../../evil.rrd"
+ )
+ self.assertTrue(ds.rrd_path.endswith("_.._.._.._evil.rrd"))
+ self.assertIn(settings.RRD_DB_PATH.as_posix(), ds.rrd_path)