Beispiel #1
0
 def test_create_VM_STOR_RESERVED_0M(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1G',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'setReservedMem': ''
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1G 1G G\nCPU 00 BASE\n'
         b'COMMAND DEF STOR RESERVED 0M\n')
Beispiel #2
0
 def test_create_VM_swap_256M(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1G',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'vdisk': '0102:256M'
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1G 1G G\nCPU 00 BASE\n'
         b'MDISK 0102 FB-512 V-DISK 524288 MWV\n')
Beispiel #3
0
 def test_create_VM_account(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1G',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'account': "acc acc1 acc2 dummy"
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1G 1G G\n'
         b'ACCOUNT ACC ACC1 ACC2 DUMMY\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n')
Beispiel #4
0
 def test_create_VM_profile(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1G',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'profName': "Profile1"
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1G 1G G\n'
         b'INCLUDE PROFILE1\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n')
Beispiel #5
0
 def test_create_with_logonby(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1024M',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'byUsers': ['USER1', 'USER2']
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1024M 1G G\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n'
         b'LOGONBY USER1 USER2\n')
Beispiel #6
0
 def test_create_with_pcif(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1024M',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'commandPcif': '100:200'
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1024M 1G G\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n'
         b'COMMAND ATTACH PCIF 100 * AS 200\n')
Beispiel #7
0
 def test_create_with_rdomain(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1024M',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'commandRDomain': 'Z15ONLY'
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1024M 1G G\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n'
         b'COMMAND SET VMRELOCATE * DOMAIN Z15ONLY\n')
Beispiel #8
0
 def test_create_with_share(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1024M',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'commandSetShare': 'RELATIVE 125'
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1024M 1G G\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n'
         b'COMMAND SET SHARE &USERID RELATIVE 125\n')
Beispiel #9
0
 def test_create_with_cpupool(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1024M',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'commandSchedule': 'POOL1'
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1024M 1G G\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n'
         b'COMMAND SCHEDULE * WITHIN POOL POOL1\n')
Beispiel #10
0
 def test_create_VM_STOR_RESERVED_0M_diff_unit(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1024M',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'setReservedMem': ''
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1024M 1G G\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n'
         b'COMMAND DEF STOR RESERVED 0M\n')
Beispiel #11
0
 def test_create_VM_swap_2048M(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1G',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'vdisk': '0102:2048M'
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1G 1G G\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n'
         b'MDISK 0102 FB-512 V-DISK 4194296 MWV\n')
Beispiel #12
0
 def test_create_with_profile(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1024M',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'comment': 'comment1$@$@$this is comment2$@$@$'
     }
     rh.parms = parms
     makeVM.createVM(rh)
     write.assert_called_with(
         mock.ANY, b'USER  pwd 1024M 1G G\n'
         b'COMMAND SET VCONFIG MODE LINUX\n'
         b'COMMAND DEFINE CPU 00 TYPE IFL\n'
         b'* COMMENT1\n'
         b'* THIS IS COMMENT2\n')
Beispiel #13
0
 def test_create_VM_swap_4096M(self, write):
     rh = ReqHandle.ReqHandle(captureLogs=False, smt=mock.Mock())
     parms = {
         'pw': 'pwd',
         'priMemSize': '1G',
         'maxMemSize': '1G',
         'privClasses': 'G',
         'vdisk': '0102:4096M'
     }
     rh.parms = parms
     rs = makeVM.createVM(rh)
     self.assertEqual(4, rs)