Esempio n. 1
0
 def test_write_v21(self):
     self._set_api_version()
     with a10.A10WriteContext(self.handler, self.ctx, self.m) as c:
         c
     self.a.last_client.system.action.activate_and_write.assert_called(
         None, "shared")
     self.a.last_client.session.close.assert_called_with()
 def test_write_v21(self):
     self._set_api_version("2.1")
     with a10.A10WriteContext(self.handler, self.ctx, self.m, device_name='axadp-noalt') as c:
         c
     self.a.last_client.system.action.activate_and_write.assert_called_with(
         mock.ANY)
     self.a.last_client.session.close.assert_called_with()
Esempio n. 3
0
 def test_partition_name_withalt(self):
     with a10.A10WriteContext(self.handler,
                              self.ctx,
                              self.m,
                              device_name='axadp-alt') as c:
         # shared_partition has no effect on an ADP configured device
         self.assertEqual(c.partition_name, self.m['tenant_id'][0:13])
 def test_ha(self):
     with a10.A10WriteContext(self.handler, self.ctx, self.m,
                              device_name='ax4') as c:
         c
     self.a.last_client.ha.sync.assert_called_with(
         '1.1.1.1', 'admin', 'a10')
     self.a.last_client.session.close.assert_called_with()
 def test_write_e(self):
     try:
         with a10.A10WriteContext(self.handler, self.ctx, self.m) as c:
             c
             raise FakeException()
     except FakeException:
         self.empty_close_mocks()
         pass
    def test_write_v21_deleted_partition(self):
        self._set_api_version("2.1")
        with a10.A10WriteContext(self.handler, self.ctx, self.m, device_name='axadp-noalt') as c:
            c
            c.partition_name = None

        self.a.last_client.system.action.activate_and_write.assert_called_with(None)
        self.a.last_client.session.close.assert_called_with()
    def test_write_v21_partition(self):
        self._set_api_version("2.1")
        expected = "part1"
        with a10.A10WriteContext(self.handler, self.ctx, self.m) as c:
            c
            c.partition_name = expected

        self.a.last_client.system.action.activate_and_write.assert_called_with(expected)
        self.a.last_client.session.close.assert_called_with()
 def test_write(self):
     with a10.A10WriteContext(self.handler, self.ctx, self.m) as c:
         c
     self.a.last_client.system.action.write_memory.assert_called_with()
     self.a.last_client.session.close.assert_called_with()
 def test_write_v30(self):
     self._set_api_version("3.0")
     with a10.A10WriteContext(self.handler, self.ctx, self.m) as c:
         c
     self.a.last_client.system.action.write_memory.assert_called()
     self.a.last_client.session.close.assert_called_with()
 def test_partition_name(self):
     with a10.A10WriteContext(self.handler, self.ctx, self.m, device_name='axadp-noalt') as c:
         self.assertEqual(c.partition_name, self.m['tenant_id'][0:13])
 def test_partition_name_withalt(self):
     with a10.A10WriteContext(self.handler, self.ctx, self.m, device_name='axadp-alt') as c:
         self.assertEqual(c.partition_name, 'mypart')
 def test_write_v30(self):
     with a10.A10WriteContext(self.handler, self.ctx, self.m) as c:
         c
     self.a.last_client.system.action.activate_and_write.assert_called_with(mock.ANY)
     self.a.last_client.session.close.assert_called_with()