Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
irmago
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
IRMA
Github mirrors
irmago
Commits
78e92305
Commit
78e92305
authored
Jan 31, 2020
by
Ivar Derksen
Committed by
Sietse Ringers
Feb 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved TestSessionUsingLegacyStorage and deleted some duplicate test code
parent
139f92f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
internal/sessiontest/legacy_test.go
internal/sessiontest/legacy_test.go
+15
-6
irmaclient/irmaclient_test.go
irmaclient/irmaclient_test.go
+6
-16
No files found.
internal/sessiontest/legacy_test.go
View file @
78e92305
...
...
@@ -12,15 +12,24 @@ func TestSessionUsingLegacyStorage(t *testing.T) {
defer
test
.
SetTestStorageDir
(
"teststorage"
)
client
,
_
:=
parseStorage
(
t
)
defer
test
.
ClearTestStorage
(
t
)
// Test whether credential from legacy storage is still usable
idStudentCard
:=
irma
.
NewAttributeTypeIdentifier
(
"irma-demo.RU.studentCard.studentID"
)
request
:=
getDisclosureRequest
(
idStudentCard
)
sessionHelper
(
t
,
request
,
"verification"
,
client
)
// Issue new credential
sessionHelper
(
t
,
getMultipleIssuanceRequest
(),
"issue"
,
client
)
// Close client to prevent database to be opened twice
err
:=
client
.
Close
()
require
.
NoError
(
t
,
err
)
// Test whether credential is still there
id
:=
irma
.
NewAttributeTypeIdentifier
(
"irma-demo.MijnOverheid.root.BSN"
)
sessionHelper
(
t
,
getDisclosureRequest
(
id
),
"verification"
,
client
)
idRoot
:=
irma
.
NewAttributeTypeIdentifier
(
"irma-demo.MijnOverheid.root.BSN"
)
sessionHelper
(
t
,
getDisclosureRequest
(
idRoot
),
"verification"
,
client
)
// Re-open client
require
.
NoError
(
t
,
client
.
Close
())
client
,
_
=
parseExistingStorage
(
t
)
// Test whether credential is still there after the storage has been reloaded
sessionHelper
(
t
,
getDisclosureRequest
(
idRoot
),
"verification"
,
client
)
}
irmaclient/irmaclient_test.go
View file @
78e92305
...
...
@@ -315,11 +315,8 @@ func TestFreshStorage(t *testing.T) {
path
:=
filepath
.
Join
(
test
.
FindTestdataFolder
(
t
),
"storage"
,
"test"
)
err
:=
fs
.
EnsureDirectoryExists
(
path
)
require
.
NoError
(
t
,
err
)
client
,
err
:=
New
(
filepath
.
Join
(
".."
,
"testdata"
,
"storage"
,
"test"
),
filepath
.
Join
(
".."
,
"testdata"
,
"irma_configuration"
),
&
TestClientHandler
{
t
:
t
},
)
client
:=
parseExistingStorage
(
t
)
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
client
)
}
...
...
@@ -333,12 +330,8 @@ func TestKeyshareEnrollmentRemoval(t *testing.T) {
err
=
client
.
storage
.
db
.
Close
()
require
.
NoError
(
t
,
err
)
client
,
err
=
New
(
filepath
.
Join
(
".."
,
"testdata"
,
"storage"
,
"test"
),
filepath
.
Join
(
".."
,
"testdata"
,
"irma_configuration"
),
&
TestClientHandler
{
t
:
t
},
)
require
.
NoError
(
t
,
err
)
client
=
parseExistingStorage
(
t
)
require
.
NotContains
(
t
,
client
.
keyshareServers
,
"test"
)
}
...
...
@@ -351,11 +344,8 @@ func TestUpdatePreferences(t *testing.T) {
err
:=
client
.
storage
.
db
.
Close
()
require
.
NoError
(
t
,
err
)
client
,
err
=
New
(
filepath
.
Join
(
".."
,
"testdata"
,
"storage"
,
"test"
),
filepath
.
Join
(
".."
,
"testdata"
,
"irma_configuration"
),
&
TestClientHandler
{
t
:
t
},
)
client
=
parseExistingStorage
(
t
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
false
,
client
.
Preferences
.
EnableCrashReporting
)
}
...
...
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