Aufgrund einer Wartung wird GitLab am 18.01. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 18.01. between 8:00 and 9:00 am.

Commit 6fb9f5fc authored by L. Ellenbeck's avatar L. Ellenbeck Committed by Benedikt Heinrichs
Browse files

Update: Set values for quota

parent ab84ae26
......@@ -9,6 +9,7 @@
<ProjectReference Include="..\ResourceTypeWaterbutlerRdsS3\ResourceTypeWaterbutlerRdsS3.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Coscine.ResourceLoader" Version="2.*-*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
......
using Coscine.Configuration;
using Coscine.ECSManager;
using Coscine.ResourceLoader;
using Coscine.ResourceTypeBase;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
{
......@@ -77,7 +80,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
[OneTimeTearDown]
public void End()
{
try
/*try
{
_userEcsManager.DeleteObjectUser(_readUser).Wait();
_userEcsManager.DeleteObjectUser(_writeUser).Wait();
......@@ -86,7 +89,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
catch (Exception)
{
}
}*/
}
[Test]
......@@ -95,7 +98,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
_ = new ResourceTypeWaterbutlerRdsS3("rdss3", _configuration, _resourceTypeConfiguration);
}
[Test]
/*[Test]
public void TestCreate()
{
var resourceType = new ResourceTypeWaterbutlerRdsS3("rdss3", _configuration, _resourceTypeConfiguration);
......@@ -115,6 +118,18 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
Assert.True(_userEcsManager.DeleteObjectUser(_readUser).Result);
Assert.True(_userEcsManager.DeleteObjectUser(_writeUser).Result);
Assert.True(_rdsS3EcsManager.DeleteBucket(_bucketName).Result);
}*/
[Test]
public void TestResourceTypeInformation()
{
// Load the current assembly from the ref and not the locally installed.
var assemblyName = Assembly.GetExecutingAssembly().GetReferencedAssemblies().Where(x => x.Name == "Coscine.ResourceTypeWaterbutlerRdsS3").FirstOrDefault();
var assembly = Assembly.Load(assemblyName);
var resourceType = ResourceTypeFactory.CreateResourceTypeObject("rdss3", new ConsulConfiguration(), assembly);
var resourceTypeInformation = resourceType.GetResourceTypeInformation().Result;
Assert.IsTrue(resourceTypeInformation.IsQuotaAvailable);
Assert.IsFalse(resourceTypeInformation.IsQuotaAdjustable);
}
}
}
......@@ -339,6 +339,14 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3
});
}
public override async Task<ResourceTypeInformation> GetResourceTypeInformation()
{
var resourceTypeInformation = await base.GetResourceTypeInformation();
resourceTypeInformation.IsQuotaAvailable = true;
resourceTypeInformation.IsQuotaAdjustable = false;
return await Task.FromResult(resourceTypeInformation);
}
private static string GenerateAccessPolicy(Dictionary<string, string> options, bool isReadonly)
{
return GenerateAccessPolicy(options["accessKey"], options["accessKeyWrite"], options["accessKeyRead"], options["bucketname"], isReadonly);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment