public void TestGetPlanId(int id, int cpu, int ram, string type) { using var requests = new MockVultrRequests( new HttpHandler( "/plans/list", Resources.VultrPlansList)); var provisioner = new VultrServerProvisioner(requests.Client); Assert.Equal(id, provisioner.GetPlanId( new Plan(cpu, ram, type))); }
public void TestGetIso() { using var requests = new MockVultrRequests( new HttpHandler( "/iso/list", Resources.VultrISOList)); var provisioner = new VultrServerProvisioner(requests.Client); var server = new Server( new OperatingSystem(iso: "installcoreos.iso"), Plan, Region); var os = provisioner.GetOs(server); Assert.Equal(159, os.OsId); Assert.Null(os.Appid); Assert.Null(os.ScriptId); Assert.Null(os.SnapshotId); Assert.True(os.IsoId > 0); }
public void TestGetOs(int id, string name) { using var requests = new MockVultrRequests( new HttpHandler( "/os/list", Resources.VultrOSList)); var provisioner = new VultrServerProvisioner(requests.Client); var server = new Server( new OperatingSystem(name: name), Plan, Region); var os = provisioner.GetOs(server); Assert.Equal(id, os.OsId); Assert.Null(os.Appid); Assert.Null(os.IsoId); Assert.Null(os.ScriptId); Assert.Null(os.SnapshotId); }
public void TestGetOsApp() { using var requests = new MockVultrRequests( new HttpHandler( "/app/list", Resources.VultrAppList)); var provisioner = new VultrServerProvisioner(requests.Client); var server = new Server( new OperatingSystem("LAMP on CentOS 7 x64"), Plan, Region); var os = provisioner.GetOs(server); Assert.Equal(186, os.OsId); Assert.Equal(41, os.Appid); Assert.Null(os.IsoId); Assert.Null(os.ScriptId); Assert.Null(os.SnapshotId); }
public void TestGetOsScript() { using var requests = new MockVultrRequests( new HttpHandler( "/os/list", Resources.VultrOSList), new HttpHandler( "/startupscript/list", Resources.VultrStartupScripts)); var provisioner = new VultrServerProvisioner(requests.Client); var server = new Server( new OperatingSystem(name: "Fedora 32 x64"), Plan, Region, startupScript: "hello-boot"); var os = provisioner.GetOs(server); Assert.Equal(389, os.OsId); Assert.Equal(3, os.ScriptId); Assert.Null(os.Appid); Assert.Null(os.IsoId); Assert.Null(os.SnapshotId); }