Commits (5)
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<ProjectReference Include="..\ResourceTypeWaterbutlerRdsS3\ResourceTypeWaterbutlerRdsS3.csproj" /> <ProjectReference Include="..\ResourceTypeWaterbutlerRdsS3\ResourceTypeWaterbutlerRdsS3.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Coscine.ResourceLoader" Version="2.*-*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="NUnit" Version="3.13.1" /> <PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" /> <PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
......
using Coscine.Configuration; using Coscine.Configuration;
using Coscine.ECSManager; using Coscine.ECSManager;
using Coscine.ResourceLoader;
using Coscine.ResourceTypeBase; using Coscine.ResourceTypeBase;
using NUnit.Framework; using NUnit.Framework;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
{ {
...@@ -77,7 +80,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test ...@@ -77,7 +80,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
[OneTimeTearDown] [OneTimeTearDown]
public void End() public void End()
{ {
try /*try
{ {
_userEcsManager.DeleteObjectUser(_readUser).Wait(); _userEcsManager.DeleteObjectUser(_readUser).Wait();
_userEcsManager.DeleteObjectUser(_writeUser).Wait(); _userEcsManager.DeleteObjectUser(_writeUser).Wait();
...@@ -86,7 +89,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test ...@@ -86,7 +89,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
catch (Exception) catch (Exception)
{ {
} }*/
} }
[Test] [Test]
...@@ -95,7 +98,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test ...@@ -95,7 +98,7 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
_ = new ResourceTypeWaterbutlerRdsS3("rdss3", _configuration, _resourceTypeConfiguration); _ = new ResourceTypeWaterbutlerRdsS3("rdss3", _configuration, _resourceTypeConfiguration);
} }
[Test] /*[Test]
public void TestCreate() public void TestCreate()
{ {
var resourceType = new ResourceTypeWaterbutlerRdsS3("rdss3", _configuration, _resourceTypeConfiguration); var resourceType = new ResourceTypeWaterbutlerRdsS3("rdss3", _configuration, _resourceTypeConfiguration);
...@@ -115,6 +118,18 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test ...@@ -115,6 +118,18 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
Assert.True(_userEcsManager.DeleteObjectUser(_readUser).Result); Assert.True(_userEcsManager.DeleteObjectUser(_readUser).Result);
Assert.True(_userEcsManager.DeleteObjectUser(_writeUser).Result); Assert.True(_userEcsManager.DeleteObjectUser(_writeUser).Result);
Assert.True(_rdsS3EcsManager.DeleteBucket(_bucketName).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 ...@@ -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) private static string GenerateAccessPolicy(Dictionary<string, string> options, bool isReadonly)
{ {
return GenerateAccessPolicy(options["accessKey"], options["accessKeyWrite"], options["accessKeyRead"], options["bucketname"], isReadonly); return GenerateAccessPolicy(options["accessKey"], options["accessKeyWrite"], options["accessKeyRead"], options["bucketname"], isReadonly);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<RootNamespace>Coscine.ResourceTypeWaterbutlerRdsS3</RootNamespace> <RootNamespace>Coscine.ResourceTypeWaterbutlerRdsS3</RootNamespace>
<AssemblyName>Coscine.ResourceTypeWaterbutlerRdsS3</AssemblyName> <AssemblyName>Coscine.ResourceTypeWaterbutlerRdsS3</AssemblyName>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<Version>1.3.0</Version> <Version>1.4.0</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<Authors>RWTH Aachen University</Authors> <Authors>RWTH Aachen University</Authors>
......