Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327686 )

Change subject: tests: Use cp0xxx instead of cp1xxx for sample data
......................................................................

tests: Use cp0xxx instead of cp1xxx for sample data

Avoid matches in cross-repo searches for wmf-production
host names.

Change-Id: Idee279516003af115e8b7bb47387cfc4eb267f09
---
M conftool/tests/fixtures/nodes/eqiad.yaml
M conftool/tests/integration/test_tool.py
M conftool/tests/unit/test_cli_tool.py
3 files changed, 26 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/conftool 
refs/changes/86/327686/1

diff --git a/conftool/tests/fixtures/nodes/eqiad.yaml 
b/conftool/tests/fixtures/nodes/eqiad.yaml
index 156a117..84dce97 100644
--- a/conftool/tests/fixtures/nodes/eqiad.yaml
+++ b/conftool/tests/fixtures/nodes/eqiad.yaml
@@ -1,37 +1,37 @@
 cache_text:
-  cp1008:
+  cp0008:
     - varnish-fe
     - varnish-be
     - https
-  cp1052:
+  cp0052:
     - varnish-fe
     - varnish-be
     - https
-  cp1053:
+  cp0053:
     - varnish-fe
     - varnish-be
     - https
-  cp1054:
+  cp0054:
     - varnish-fe
     - varnish-be
     - https
-  cp1055:
+  cp0055:
     - varnish-fe
     - varnish-be
     - https
-  cp1065:
+  cp0065:
     - varnish-fe
     - varnish-be
     - https
-  cp1066:
+  cp0066:
     - varnish-fe
     - varnish-be
     - https
-  cp1067:
+  cp0067:
     - varnish-fe
     - varnish-be
     - https
-  cp1068:
+  cp0068:
     - varnish-fe
     - varnish-be
     - https
diff --git a/conftool/tests/integration/test_tool.py 
b/conftool/tests/integration/test_tool.py
index 08dd81b..22197d5 100644
--- a/conftool/tests/integration/test_tool.py
+++ b/conftool/tests/integration/test_tool.py
@@ -54,23 +54,23 @@
         return args
 
     def test_get_node(self):
-        args = self.generate_args('get cp1008')
+        args = self.generate_args('get cp0008')
         output = self.output_for(args)[0]
         k = output.keys()
         k.sort()
-        self.assertEquals(k, ['cp1008', 'tags'])
-        self.assertEquals(output['cp1008']['pooled'], 'no')
+        self.assertEquals(k, ['cp0008', 'tags'])
+        self.assertEquals(output['cp0008']['pooled'], 'no')
         # Check the irc message was not sent for a get operation
         self.assertEquals(self.irc.emit.called, False)
 
     def test_find_node(self):
-        args = ['find', '--action', 'get', 'cp1008']
+        args = ['find', '--action', 'get', 'cp0008']
         output = self.output_for(args)
         self.assertEquals(len(output), 3)
         for serv in output:
             self.assertTrue(serv['tags'].startswith('dc=eqiad'))
         # Test that old-style parameters are still valid
-        args = ['--find', '--action', 'get', 'cp1008']
+        args = ['--find', '--action', 'get', 'cp0008']
         output = self.output_for(args)
         self.assertEquals(len(output), 3)
         # Check the irc message was not sent for a get operation
@@ -80,12 +80,12 @@
         """
         Changing values according to a regexp
         """
-        args = self.generate_args('set/pooled=yes re:cp105.')
+        args = self.generate_args('set/pooled=yes re:cp005.')
         with self.assertRaises(SystemExit) as cm:
             tool.main(cmdline=args)
             self.assertEquals(cm.exception_code, 0)
         self.assertEquals(self.irc.emit.called, True)
-        for hostname in ['cp1052', 'cp1053', 'cp1054', 'cp1055']:
+        for hostname in ['cp0052', 'cp0053', 'cp0054', 'cp0055']:
             n = node.Node('eqiad', 'cache_text', 'https', hostname)
             self.assertTrue(n.exists)
             self.assertEquals(n.pooled, "yes")
@@ -94,14 +94,14 @@
         """
         Test creation is not possible from confctl
         """
-        args = self.generate_args('set/pooled=yes cp1059')
+        args = self.generate_args('set/pooled=yes cp0059')
         with self.assertRaises(SystemExit) as cm:
             tool.main(cmdline=args)
             # In error, we exit with status 1
             self.assertEquals(cm.exception_code, 1)
         # This doesn't get announced to irc.
         self.assertEquals(self.irc.emit.called, False)
-        n = node.Node('eqiad', 'cache_text', 'https', 'cp1059')
+        n = node.Node('eqiad', 'cache_text', 'https', 'cp0059')
         self.assertFalse(n.exists)
 
     def test_select_nodes(self):
diff --git a/conftool/tests/unit/test_cli_tool.py 
b/conftool/tests/unit/test_cli_tool.py
index 93aedeb..a4d67e1 100644
--- a/conftool/tests/unit/test_cli_tool.py
+++ b/conftool/tests/unit/test_cli_tool.py
@@ -59,12 +59,12 @@
         )
 
         t = tool.ToolCliFind(args)
-        t._namedef = 'cp1048.example.com'
+        t._namedef = 'cp0048.example.com'
         res = [
             node.Node('test', 'cache',
-                      'ssl', 'cp1048.example.com'),
+                      'ssl', 'cp0048.example.com'),
             node.Node('test', 'cache',
-                      'http', 'cp1048.example.com'),
+                      'http', 'cp0048.example.com'),
         ]
         t.entity.find = mock.MagicMock(return_value=res)
         tres = [o for o in t.host_list()]
@@ -74,9 +74,9 @@
     def test_hosts_list_tags(self):
         """Tests getting the host list"""
         host_dir = [
-            ('cp1011.example.com', {'pooled': 'yes'}),
-            ('cp1020.example.com', {'pooled': 'no'}),
-            ('cp1014.local', {'pooled': 'no'})
+            ('cp0011.example.com', {'pooled': 'yes'}),
+            ('cp0020.example.com', {'pooled': 'no'}),
+            ('cp0014.local', {'pooled': 'no'})
         ]
         self._mock_list(host_dir)
         args = self._mock_args(taglist="dc=a,cluster=b,service=apache2")
@@ -101,7 +101,7 @@
 
         # Regex matching
         l = tagged(args, 're:.*\.local', 'get')
-        self.assertEquals(l, ['cp1014.local'])
+        self.assertEquals(l, ['cp0014.local'])
 
         # All nodes set raise a system exit
         with self.assertRaises(SystemExit):
@@ -109,7 +109,7 @@
 
         # Majority of nodes via a regex will raise a system exit
         with self.assertRaises(SystemExit):
-            tagged(args, 're:cp10(11|20)\.example\.com', 'set')
+            tagged(args, 're:cp00(11|20)\.example\.com', 'set')
 
     def test_host_multiple_services(self):
         """Set all services in a single host w/ and w/o the --host flag"""

-- 
To view, visit https://gerrit.wikimedia.org/r/327686
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idee279516003af115e8b7bb47387cfc4eb267f09
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/conftool
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to