Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.71 KB | None | 0 0
  1.     def test_provision_two_disks_swift(self):
  2.         deploy_conf = {
  3.             "partitions_policy": "clean",
  4.             "partitions": [
  5.                 {
  6.                     "id": {"type": "name", "value": "vda"},
  7.                     "size": "4000",
  8.                     "type": "disk",
  9.                     "volumes": [
  10.                         {
  11.                             "mount": "/",
  12.                             "type": "partition",
  13.                             "file_system": "ext4",
  14.                             "size": "3000"
  15.                         }
  16.                     ],
  17.  
  18.                 },
  19.                 {
  20.                     "id": {"type": "name", "value": "vdb"},
  21.                     "size": "2000",
  22.                     "type": "disk",
  23.                     "volumes": [
  24.                         {
  25.                             "mount": "/home",
  26.                             "type": "partition",
  27.                             "file_system": "ext3",
  28.                             "size": "1000"
  29.                         }
  30.                     ],
  31.  
  32.                 }
  33.             ]
  34.         }
  35.         self.env.setup(node_template="two_disks.xml",
  36.                        deploy_config=deploy_conf,
  37.                        tenant_image='centos-7.1.1503.fpa_func_test.raw')
  38.  
  39.         node = self.env.node
  40.  
  41.         node.run_cmd('provision --data_driver ironic --deploy_driver swift',
  42.                      check_ret_code=True,
  43.                      get_fuel_log=True)
  44.  
  45.         actual = node.run_cmd('parted -l')[0]
  46.         expected = """
  47. Model: Virtio Block Device (virtblk)
  48. Disk /dev/vda: 4295MB
  49. Sector size (logical/physical): 512B/512B
  50. Partition Table: gpt
  51. Disk Flags:
  52.  
  53. Number  Start   End     Size    File system  Name     Flags
  54. 1      1049kB  26.2MB  25.2MB               primary  bios_grub
  55. 2      26.2MB  3172MB  3146MB  ext4         primary
  56.  
  57.  
  58. Model: Virtio Block Device (virtblk)
  59. Disk /dev/vdb: 2147MB
  60. Sector size (logical/physical): 512B/512B
  61. Partition Table: gpt
  62. Disk Flags:
  63.  
  64. Number  Start   End     Size    File system  Name     Flags
  65. 1      1049kB  26.2MB  25.2MB               primary  bios_grub
  66. 2      26.2MB  1075MB  1049MB  ext3         primary
  67. """
  68.  
  69.         utils.assertNoDiff(expected, actual)
  70.  
  71.         node.reboot_to_hdd()
  72.         node.wait_for_boot()
  73.  
  74.         # Set node.ssh_key to "path to tenant key"
  75.         # (if tenant key is different than deploy key)
  76.         node.ssh_login = "centos"
  77.         actual = node.run_cmd('uname -a')[0]
  78.         expected = ('Linux fpa-func-test-tenant-vm 3.10.0-229.20.1.el7.x86_64'
  79.                     ' #1 SMP Tue Nov 3 19:10:07 UTC 2015 x86_64 x86_64 x86_64'
  80.                     ' GNU/Linux\n')
  81.  
  82.         utils.assertNoDiff(expected, actual)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement