Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
libraries
ResourceTypeWaterbutlerRdsS3
Commits
6eb1a877
Commit
6eb1a877
authored
Aug 30, 2021
by
Petar Hristov
💬
Browse files
Fix: Updated dependency
parent
2f175428
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
6eb1a877
# Resource Type Waterbutler RDS S3
# Resource Type Waterbutler RDS S3
\ No newline at end of file
src/ResourceTypeWaterbutlerRdsS3.Tests/ResourceTypeWaterbutlerS3Tests.cs
→
src/ResourceTypeWaterbutlerRdsS3.Tests/ResourceTypeWaterbutler
Rds
S3Tests.cs
View file @
6eb1a877
...
@@ -11,7 +11,7 @@ using System.Reflection;
...
@@ -11,7 +11,7 @@ using System.Reflection;
namespace
Coscine.ResourceTypeWaterbutlerRdsS3.Test
namespace
Coscine.ResourceTypeWaterbutlerRdsS3.Test
{
{
[
TestFixture
]
[
TestFixture
]
public
class
ResourceTypeWaterbutlerS3Tests
public
class
ResourceTypeWaterbutler
Rds
S3Tests
{
{
private
readonly
string
_testPrefix
=
"Coscine-ResourceTypeWaterbutlerS3Tests-Tests"
;
private
readonly
string
_testPrefix
=
"Coscine-ResourceTypeWaterbutlerS3Tests-Tests"
;
private
readonly
string
_rdsS3KeyPrefix
=
"coscine/global/rds/ecs-rwth/rds-s3"
;
private
readonly
string
_rdsS3KeyPrefix
=
"coscine/global/rds/ecs-rwth/rds-s3"
;
...
@@ -22,6 +22,9 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
...
@@ -22,6 +22,9 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
private
EcsManager
_rdsS3EcsManager
;
private
EcsManager
_rdsS3EcsManager
;
private
EcsManager
_userEcsManager
;
private
EcsManager
_userEcsManager
;
private
string
_resourceType
;
private
string
_localAssemblyName
;
private
long
_quota
;
private
long
_quota
;
private
Guid
_guid
;
private
Guid
_guid
;
...
@@ -36,20 +39,23 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
...
@@ -36,20 +39,23 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
private
string
_accessKey
;
private
string
_accessKey
;
[
OneTimeSetUp
]
[
OneTimeSetUp
]
public
void
Set
u
p
()
public
void
OneTime
Set
U
p
()
{
{
_resourceTypeConfiguration
.
Config
=
new
Dictionary
<
string
,
string
>
_resourceTypeConfiguration
.
Config
=
new
Dictionary
<
string
,
string
>
{
{
};
};
_resourceType
=
"rdss3"
;
_localAssemblyName
=
"Coscine.ResourceTypeWaterbutlerRdsS3"
;
_quota
=
1
;
_quota
=
1
;
_guid
=
Guid
.
NewGuid
();
_guid
=
Guid
.
NewGuid
();
_bucketName
=
$"
{
_testPrefix
}
.
{
_guid
}
"
;
_bucketName
=
$"
{
_testPrefix
}
.
{
_guid
}
"
;
_secretKey
=
"VERY_S3cr3t_Key!!!"
;
_secretKey
=
"VERY_S3cr3t_Key!!!"
;
_readUser
=
$"
{
_testPrefix
}
.read_
{
_guid
}
"
;
_readUser
=
$"
{
_testPrefix
}
.read_
{
_guid
}
"
;
_writeUser
=
$"
{
_testPrefix
}
.write_
{
_guid
}
"
;
_writeUser
=
$"
{
_testPrefix
}
.write_
{
_guid
}
"
;
_endpoint
=
_configuration
.
GetString
(
"coscine/global/rds/ecs-rwth/rds-s3
/s3_endpoint"
);
_endpoint
=
_configuration
.
GetString
(
$"
{
_rdsS3KeyPrefix
}
/s3_endpoint"
);
_accessKey
=
_configuration
.
GetString
(
"coscine/global/rds/ecs-rwth/rds-s3
/object_user_name"
);
_accessKey
=
_configuration
.
GetString
(
$"
{
_rdsS3KeyPrefix
}
/object_user_name"
);
_rdsS3EcsManager
=
new
EcsManager
_rdsS3EcsManager
=
new
EcsManager
{
{
EcsManagerConfiguration
=
new
EcsManagerConfiguration
EcsManagerConfiguration
=
new
EcsManagerConfiguration
...
@@ -78,9 +84,9 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
...
@@ -78,9 +84,9 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
}
}
[
OneTimeTearDown
]
[
OneTimeTearDown
]
public
void
End
()
public
void
OneTimeTearDown
()
{
{
/*
try
try
{
{
_userEcsManager
.
DeleteObjectUser
(
_readUser
).
Wait
();
_userEcsManager
.
DeleteObjectUser
(
_readUser
).
Wait
();
_userEcsManager
.
DeleteObjectUser
(
_writeUser
).
Wait
();
_userEcsManager
.
DeleteObjectUser
(
_writeUser
).
Wait
();
...
@@ -89,19 +95,19 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
...
@@ -89,19 +95,19 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
catch
(
Exception
)
catch
(
Exception
)
{
{
}
*/
}
}
}
[
Test
]
[
Test
]
public
void
TestConstructor
()
public
void
TestConstructor
()
{
{
_
=
new
ResourceTypeWaterbutlerRdsS3
(
"rdss3"
,
_configuration
,
_resourceTypeConfiguration
);
_
=
new
ResourceTypeWaterbutlerRdsS3
(
_resourceType
,
_configuration
,
_resourceTypeConfiguration
);
}
}
/*
[Test]
[
Test
]
public
void
TestCreate
()
public
void
TestCreate
()
{
{
var resourceType = new ResourceTypeWaterbutlerRdsS3(
"rdss3"
, _configuration, _resourceTypeConfiguration);
var
resourceType
=
new
ResourceTypeWaterbutlerRdsS3
(
_resourceType
,
_configuration
,
_resourceTypeConfiguration
);
resourceType
.
CreateResource
(
new
Dictionary
<
string
,
string
>
{
resourceType
.
CreateResource
(
new
Dictionary
<
string
,
string
>
{
{
"bucketname"
,
_bucketName
},
{
"bucketname"
,
_bucketName
},
{
"size"
,
$"
{
_quota
}
"
},
{
"size"
,
$"
{
_quota
}
"
},
...
@@ -114,19 +120,18 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
...
@@ -114,19 +120,18 @@ namespace Coscine.ResourceTypeWaterbutlerRdsS3.Test
{
"readonly"
,
"false"
},
{
"readonly"
,
"false"
},
}).
Wait
();
}).
Wait
();
// No implementation for deletion
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
]
[
Test
]
public
void
TestResourceTypeInformation
()
public
void
TestResourceTypeInformation
()
{
{
// Load the current assembly from the ref and not the locally installed.
// 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
assemblyName
=
Assembly
.
GetExecutingAssembly
().
GetReferencedAssemblies
().
Where
(
x
=>
x
.
Name
==
_localAssemblyName
).
FirstOrDefault
();
var
assembly
=
Assembly
.
Load
(
assemblyName
);
var
assembly
=
Assembly
.
Load
(
assemblyName
);
var
resourceType
=
ResourceTypeFactory
.
CreateResourceTypeObject
(
"rdss3"
,
new
ConsulConfiguration
(),
assembly
);
var
resourceType
=
ResourceTypeFactory
.
CreateResourceTypeObject
(
_resourceType
,
new
ConsulConfiguration
(),
assembly
);
var
resourceTypeInformation
=
resourceType
.
GetResourceTypeInformation
().
Result
;
var
resourceTypeInformation
=
resourceType
.
GetResourceTypeInformation
().
Result
;
Assert
.
IsTrue
(
resourceTypeInformation
.
IsQuotaAvailable
);
Assert
.
IsTrue
(
resourceTypeInformation
.
IsQuotaAvailable
);
Assert
.
IsFalse
(
resourceTypeInformation
.
IsQuotaAdjustable
);
Assert
.
IsFalse
(
resourceTypeInformation
.
IsQuotaAdjustable
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment