Examples of IGuestOSType


Examples of org.virtualbox_4_2.IGuestOSType

      if (nodeState == null)
         nodeState = Status.UNRECOGNIZED;
      nodeMetadataBuilder.status(nodeState);
      nodeMetadataBuilder = getIpAddresses(vm, nodeMetadataBuilder);
     
      IGuestOSType guestOSType = virtualboxManager.get().getVBox().getGuestOSType(vm.getOSTypeId());
      OsFamily family = parseOsFamilyOrUnrecognized(guestOSType.getDescription());
      String version = parseVersionOrReturnEmptyString(family, guestOSType.getDescription(), osVersionMap);
      OperatingSystem os = OperatingSystem.builder().description(guestOSType.getDescription()).family(family)
               .version(version).is64Bit(guestOSType.getIs64Bit()).build();
      nodeMetadataBuilder.operatingSystem(os);

      String guestOsUser = vm.getExtraData(GUEST_OS_USER);
      String guestOsPassword = vm.getExtraData(GUEST_OS_PASSWORD);
      nodeMetadataBuilder.credentials(LoginCredentials.builder()
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

      }

      final IMachine machine = manager.getVBox().findMachine(id);
      final String ipAddress = iMachineToIpAddress.apply(machine);
      final String osTypeId = machine.getOSTypeId();
      final IGuestOSType guestOSType = manager.getVBox().getGuestOSType(osTypeId);

      final Node node = Node.builder().id(machine.getId()).name(machine.getName())
            .description(machine.getDescription()).loginPort(22).group(System.getProperty(VIRTUALBOX_MACHINE_GROUP))
            .username(System.getProperty(VIRTUALBOX_MACHINE_USERNAME))
            .credential(System.getProperty(VIRTUALBOX_MACHINE_CREDENTIAL))
            .sudoPassword(System.getProperty(VIRTUALBOX_MACHINE_CREDENTIAL))
            .locationId(System.getProperty(VIRTUALBOX_MACHINE_LOCATION)).os64Bit(guestOSType.getIs64Bit())
            .osArch(guestOSType.getDescription()).osFamily(guestOSType.getFamilyDescription())
            .osVersion(guestOSType.getId()).osDescription(guestOSType.getDescription()).hostname(ipAddress).build();

      return node;

   }
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

      return computeService.runScriptOnNode(nodeId, command, options);
   }

   protected boolean isOSX(IMachine machine) {
      String osTypeId = machine.getOSTypeId();
      IGuestOSType guestOSType = manager.getVBox().getGuestOSType(osTypeId);
      return guestOSType.getFamilyDescription().equals("Other");
   }
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

   public void testCreateFromMaster() throws Exception {

      IMachine vm = createNiceMock(IMachine.class);
      VirtualBoxManager vbm = createNiceMock(VirtualBoxManager.class);
      IVirtualBox vBox = createNiceMock(IVirtualBox.class);
      IGuestOSType iGuestOSType = createNiceMock(IGuestOSType.class);
      INetworkAdapter nat = createNiceMock(INetworkAdapter.class);
      INATEngine natEng = createNiceMock(INATEngine.class);

      expect(vm.getName()).andReturn(VIRTUALBOX_IMAGE_PREFIX + MASTER_NAME).anyTimes();
      expect(vm.getState()).andReturn(MachineState.PoweredOff).anyTimes();
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

   @Test
   public void testListImages() throws Exception {

      VirtualBoxManager manager = createNiceMock(VirtualBoxManager.class);
      IVirtualBox vBox = createNiceMock(IVirtualBox.class);
      IGuestOSType osType = createNiceMock(IGuestOSType.class);

      List<IMachine> machines = Lists.newArrayList();
      IMachine imageMachine = createNiceMock(IMachine.class);
      IMachine clonedMachine = createNiceMock(IMachine.class);
      machines.add(imageMachine);
      machines.add(clonedMachine);

      expect(clonedMachine.getName()).andReturn("My Linux Node");
      expect(clonedMachine.getDescription()).andReturn("My Linux Node");
      expect(imageMachine.getName()).andReturn(VIRTUALBOX_IMAGE_PREFIX + "ubuntu-10.04");
      expect(imageMachine.getDescription()).andReturn(VIRTUALBOX_IMAGE_PREFIX + "ubuntu-10.04");

      expect(manager.getVBox()).andReturn(vBox).anyTimes();
      expect(vBox.getMachines()).andReturn(machines).anyTimes();
      expect(vBox.getGuestOSType(EasyMock.<String> anyObject())).andReturn(osType).anyTimes();
      expect(osType.getDescription()).andReturn("Ubuntu 10.04").anyTimes();
      expect(osType.getIs64Bit()).andReturn(true).anyTimes();

      replay(manager, vBox, clonedMachine, imageMachine, osType);

      Function<IMachine, Image> iMachineToImage = new IMachineToImage(
               VirtualBoxComputeServiceContextModule.toPortableImageStatus, Suppliers.ofInstance(manager), osMap);
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

   public void testConvert() throws Exception {

      VirtualBoxManager vbm = createNiceMock(VirtualBoxManager.class);
      IVirtualBox vBox = createNiceMock(IVirtualBox.class);
      IMachine vm = createNiceMock(IMachine.class);
      IGuestOSType guestOsType = createNiceMock(IGuestOSType.class);
      String linuxDescription = "Ubuntu 10.04";
      expect(vbm.getVBox()).andReturn(vBox).anyTimes();

      expect(vm.getOSTypeId()).andReturn("os-type").anyTimes();
      expect(vm.getName()).andReturn(VirtualBoxConstants.VIRTUALBOX_IMAGE_PREFIX + "my-vm-id").anyTimes();
      expect(vBox.getGuestOSType(eq("os-type"))).andReturn(guestOsType);
      expect(vm.getDescription()).andReturn("my-ubuntu-machine").anyTimes();
      expect(guestOsType.getDescription()).andReturn(linuxDescription).anyTimes();
      expect(guestOsType.getIs64Bit()).andReturn(true);
      expect(vm.getState()).andReturn(MachineState.PoweredOff);

      replay(vbm, vBox, vm, guestOsType);

      IMachineToImage fn = new IMachineToImage(VirtualBoxComputeServiceContextModule.toPortableImageStatus, Suppliers
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

   public void testConvert1() throws Exception {

      VirtualBoxManager vbm = createNiceMock(VirtualBoxManager.class);
      IVirtualBox vBox = createNiceMock(IVirtualBox.class);
      IMachine vm = createNiceMock(IMachine.class);
      IGuestOSType guestOsType = createNiceMock(IGuestOSType.class);
      String guestOsDescription = "ubuntu 11.04 server (i386)";
      String vmDescription = "ubuntu-11.04-server-i386";
      expect(vbm.getVBox()).andReturn(vBox).anyTimes();

      expect(vm.getName()).andReturn(VirtualBoxConstants.VIRTUALBOX_IMAGE_PREFIX + "my-vm-id").anyTimes();
      expect(vm.getOSTypeId()).andReturn("os-type").anyTimes();
      expect(vBox.getGuestOSType(eq("os-type"))).andReturn(guestOsType);
      expect(vm.getDescription()).andReturn(vmDescription).anyTimes();
      expect(guestOsType.getDescription()).andReturn(guestOsDescription).anyTimes();
      expect(guestOsType.getIs64Bit()).andReturn(true);
      expect(vm.getState()).andReturn(MachineState.Running);

      replay(vbm, vBox, vm, guestOsType);

      IMachineToImage fn = new IMachineToImage(VirtualBoxComputeServiceContextModule.toPortableImageStatus, Suppliers
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

   public void testUnparseableOsString() throws Exception {

      VirtualBoxManager vbm = createNiceMock(VirtualBoxManager.class);
      IVirtualBox vBox = createNiceMock(IVirtualBox.class);
      IMachine vm = createNiceMock(IMachine.class);
      IGuestOSType guestOsType = createNiceMock(IGuestOSType.class);

      expect(vbm.getVBox()).andReturn(vBox).anyTimes();

      expect(vm.getName()).andReturn(VirtualBoxConstants.VIRTUALBOX_IMAGE_PREFIX + "my-vm-id").anyTimes();
      String unknownOsDescription = "SomeOtherOs 2.04";
      expect(vm.getOSTypeId()).andReturn("os-type").anyTimes();
      expect(vm.getDescription()).andReturn("my-unknown-machine").anyTimes();
      expect(guestOsType.getDescription()).andReturn(unknownOsDescription).anyTimes();
      expect(guestOsType.getIs64Bit()).andReturn(true);
      expect(vBox.getGuestOSType(eq("os-type"))).andReturn(guestOsType);
      expect(vm.getState()).andReturn(MachineState.PoweredOff);

      replay(vbm, vBox, vm, guestOsType);
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

   @Test
   public void testConvert() throws Exception {
      VirtualBoxManager vbm = createNiceMock(VirtualBoxManager.class);
      IVirtualBox vBox = createNiceMock(IVirtualBox.class);
      IMachine vm = createNiceMock(IMachine.class);
      IGuestOSType guestOsType = createNiceMock(IGuestOSType.class);

      String linuxDescription = "Ubuntu Linux 10.04";
      String machineName = "hw-machineId";

      expect(vm.getOSTypeId()).andReturn("os-type").anyTimes();
      expect(vm.getName()).andReturn(machineName).anyTimes();

      expect(vm.getDescription()).andReturn(linuxDescription).anyTimes();

      expect(vBox.getGuestOSType(eq("os-type"))).andReturn(guestOsType);
      expect(vbm.getVBox()).andReturn(vBox);
      expect(guestOsType.getIs64Bit()).andReturn(true);

      replay(vbm, vBox, vm, guestOsType);

      Hardware hardware = new IMachineToHardware(Suppliers.ofInstance(vbm)).apply(vm);
View Full Code Here

Examples of org.virtualbox_4_2.IGuestOSType

   public void testCreateFromMaster() throws Exception {

      IMachine vm = createNiceMock(IMachine.class);
      VirtualBoxManager vbm = createNiceMock(VirtualBoxManager.class);
      IVirtualBox vBox = createNiceMock(IVirtualBox.class);
      IGuestOSType iGuestOSType = createNiceMock(IGuestOSType.class);
      INetworkAdapter nat = createNiceMock(INetworkAdapter.class);
      INATEngine natEng = createNiceMock(INATEngine.class);

      expect(vm.getName()).andReturn(VIRTUALBOX_IMAGE_PREFIX + MASTER_NAME).anyTimes();
      expect(vm.getState()).andReturn(MachineState.PoweredOff).anyTimes();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.