示例#1
0
 def test_success_case(self):
     """Return stdout_lines in case of success."""
     in_line = 'redhat-620133; redhat-630187\n'
     self.assertEqual(
         fuse.ProcessFindJbossCXFJar.process(
             ansible_result(in_line)),
         ['redhat-620133', 'redhat-630187'])
示例#2
0
 def test_eap(self):
     """'eap' found."""
     for processor in self.processors:
         self.assertEqual(
             processor.process(
                 ansible_result('  foo\n  eap bar\n  baz eap')),
             ['eap bar'])
示例#3
0
 def test_no_jboss(self):
     """No 'jboss' or 'eap' found."""
     for processor in self.processors:
         self.assertEqual(
             # Blank line in input to check that processor will skip it.
             processor.process(ansible_result('foo\nbar\n\nbaz')),
             [])
示例#4
0
 def test_success_case(self):
     """Return stdout_lines in case of success."""
     in_line = '1.3.6.Final-redhat-1**2018-01-18; ' \
         '1.3.6.Final-redhat-1**2018-01-18; ' \
         '1.3.6.Final-redhat-1**2018-01-18\n'
     expected = {'version': '1.3.6.Final-redhat-1', 'date': '2018-01-18'}
     self.assertEqual(
         eap.ProcessFindJbossEAPRunJarVer.process(ansible_result(in_line)),
         [expected, expected, expected])
示例#5
0
 def test_jboss(self):
     """'jboss' found."""
     # This tests that the processor returns the 'jboss bar' line
     # and that it does *not* return the 'baz jboss' line, becuase
     # in that line 'jboss' is not in the first piece.
     for processor in self.processors:
         self.assertEqual(
             processor.process(
                 ansible_result('  foo\n  jboss bar\n  baz jboss')),
             ['jboss bar'])
示例#6
0
 def test_success_case(self):
     """Found subman_consumed."""
     self.assertEqual(
         subman.ProcessSubmanConsumed.process(
             ansible_result('subnameA - 1\nsubnameB - 2\nsubnameC - 3')),
         [{
             'name': 'subnameA',
             'entitlement_id': '1'
         }, {
             'name': 'subnameB',
             'entitlement_id': '2'
         }, {
             'name': 'subnameC',
             'entitlement_id': '3'
         }])
示例#7
0
 def test__not_found(self):
     """Did not find cpu model name."""
     self.assertEqual(cpu.ProcessCpuModelName.process(ansible_result('')),
                      process.NO_DATA)
示例#8
0
 def test__not_found(self):
     """Did not find cpu vendor id."""
     self.assertEqual(cpu.ProcessCpuVendorId.process(ansible_result('')),
                      process.NO_DATA)
示例#9
0
 def test_success_case(self):
     """Found cpu model name."""
     self.assertEqual(
         cpu.ProcessCpuModelName.process(ansible_result('a\nb\nc')), 'a')
示例#10
0
 def test__not_found(self):
     """Did not find cpu family."""
     self.assertEqual(cpu.ProcessCpuCpuFamily.process(ansible_result('')),
                      process.NO_DATA)
示例#11
0
 def test_success_case(self):
     """Found cpu vendor id."""
     self.assertEqual(
         cpu.ProcessCpuVendorId.process(ansible_result('a\nb\nc')), 'a')
示例#12
0
 def test_no_processes(self):
     """No processes found."""
     self.assertEqual(
         eap.ProcessJbossEapProcesses.process(ansible_result('')), 0)
示例#13
0
 def test_success_case(self):
     """Found cpu family."""
     self.assertEqual(
         cpu.ProcessCpuCpuFamily.process(ansible_result('a\nb\nc')), 'a')
示例#14
0
 def test_success_case(self):
     """Found date file system create."""
     self.assertEqual(
         date.ProcessDateFilesystemCreate.process(
             ansible_result('a\nb\nc')), 'a')
示例#15
0
 def test_not_found(self):
     """Did not find date file system create."""
     self.assertEqual(date.ProcessDateMachineId.process(ansible_result('')),
                      process.NO_DATA)
示例#16
0
 def test_not_found(self):
     """Did not find cpu model ver."""
     self.assertEqual(cpu.ProcessCpuModelVer.process(ansible_result('')),
                      [])
示例#17
0
 def test_no_such_user(self):
     """'id' did not find the user."""
     self.assertEqual(
         eap.ProcessIdUJboss.process(
             ansible_result('id: jboss: no such user', rc=1)), False)
示例#18
0
 def test_success_case(self):
     """Found cpu model ver."""
     self.assertEqual(
         cpu.ProcessCpuModelVer.process(ansible_result('a\nb\nc')),
         ['a', 'b', 'c'])
示例#19
0
 def test_no_grep(self):
     """Grep sometimes doesn't appear in the ps output."""
     self.assertEqual(
         eap.ProcessJbossEapProcesses.process(ansible_result('java\nbash')),
         1)
示例#20
0
 def test_found_processes(self):
     """Found one process."""
     self.assertEqual(
         eap.ProcessJbossEapProcesses.process(
             ansible_result('java\nbash\ngrep')), 1)
示例#21
0
 def test_success_case(self):
     """Found cpu bogomips."""
     self.assertEqual(
         cpu.ProcessCpuBogomips.process(ansible_result('a\nb\nc')), 'a')
示例#22
0
 def test_user_found(self):
     """'id' found the user."""
     self.assertEqual(eap.ProcessIdUJboss.process(ansible_result('11111')),
                      True)
示例#23
0
 def test__not_found(self):
     """Did not find cpu bogomips."""
     self.assertEqual(cpu.ProcessCpuBogomips.process(ansible_result('')),
                      process.NO_DATA)
示例#24
0
 def test_unknown_error(self):
     """'id' returned an error."""
     self.assertEqual(
         eap.ProcessIdUJboss.process(
             ansible_result('something went wrong!', rc=1)),
         process.NO_DATA)
示例#25
0
 def test_not_found(self):
     """Did not find date."""
     self.assertEqual(date.ProcessDateDate.process(ansible_result('')),
                      process.NO_DATA)
示例#26
0
 def test_not_found(self):
     """Did not find subman_consumed."""
     self.assertEqual(
         subman.ProcessSubmanConsumed.process(ansible_result('')), [])
示例#27
0
 def test_success_case(self):
     """Found date machine id."""
     self.assertEqual(
         date.ProcessDateMachineId.process(ansible_result('a\nb\nc')), 'a')
示例#28
0
 def test_success_case(self):
     """Found date."""
     self.assertEqual(
         date.ProcessDateDate.process(ansible_result('a\nb\nc')),
         ['a', 'b', 'c'])
示例#29
0
 def test_success_case(self):
     """Return stdout_lines in case of success."""
     self.assertEqual(
         brms.ProcessFindBRMSKieWarVer.process(ansible_result('a\nb\nc')),
         ['a', 'b', 'c'])
示例#30
0
 def test_not_found(self):
     """Did not find date file system create."""
     self.assertEqual(
         date.ProcessDateFilesystemCreate.process(ansible_result('')), [])