Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
agkyra
Commits
1ec51a46
Commit
1ec51a46
authored
May 07, 2015
by
Giorgos Korfiatis
Browse files
update test
parent
f19a7f50
Changes
1
Hide whitespace changes
Inline
Side-by-side
agkyra/test.py
View file @
1ec51a46
...
...
@@ -197,3 +197,68 @@ print m
assert
isinstance
(
m
,
messaging
.
AckSyncMessage
)
assert
s
.
get_next_message
()
is
None
s
.
stop_notifiers
()
########################################
# Check sym links
ln1
=
"f1.link"
ln1_path
=
os
.
path
.
join
(
LOCAL_ROOT_PATH
,
ln1
)
os
.
symlink
(
f1_path
,
ln1_path
)
s
.
probe_file
(
s
.
SLAVE
,
ln1
)
state
=
db
.
get_state
(
slave
.
SIGNATURE
,
ln1
)
assert
state
.
serial
==
0
assert
state
.
info
==
{
"localfs_type"
:
"unhandled"
}
m
=
s
.
get_next_message
(
block
=
True
)
print
m
assert
isinstance
(
m
,
messaging
.
UpdateMessage
)
s
.
decide_file_sync
(
ln1
)
m
=
s
.
get_next_message
(
block
=
True
)
print
m
assert
isinstance
(
m
,
messaging
.
SyncMessage
)
m
=
s
.
get_next_message
(
block
=
True
)
print
m
assert
isinstance
(
m
,
messaging
.
AckSyncMessage
)
# Put file upstream to cause conflict
upstream_ln1_content
=
"regular"
r1
=
pithos
.
upload_from_string
(
ln1
,
upstream_ln1_content
)
s
.
probe_file
(
s
.
MASTER
,
ln1
)
s
.
probe_file
(
s
.
SLAVE
,
ln1
)
m
=
s
.
get_next_message
(
block
=
True
)
print
m
assert
isinstance
(
m
,
messaging
.
UpdateMessage
)
s
.
decide_file_sync
(
ln1
)
m
=
s
.
get_next_message
(
block
=
True
)
print
m
assert
isinstance
(
m
,
messaging
.
SyncMessage
)
m
=
s
.
get_next_message
(
block
=
True
)
print
m
assert
isinstance
(
m
,
messaging
.
ConflictStashMessage
)
stashed_ln1
=
m
.
stash_name
m
=
s
.
get_next_message
(
block
=
True
)
print
m
assert
isinstance
(
m
,
messaging
.
AckSyncMessage
)
assert
s
.
get_next_message
()
is
None
s
.
probe_file
(
s
.
SLAVE
,
stashed_ln1
)
m
=
s
.
get_next_message
(
block
=
True
)
print
m
assert
isinstance
(
m
,
messaging
.
UpdateMessage
)
assert
m
.
objname
==
stashed_ln1
state
=
db
.
get_state
(
slave
.
SIGNATURE
,
stashed_ln1
)
assert
state
.
serial
==
0
assert
state
.
info
==
{
"localfs_type"
:
"unhandled"
}
print
"FINISHED"
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