Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #89(Improve savestate error handling) #92

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Fix for issue #89(Improve savestate error handling) #92

wants to merge 8 commits into from

Conversation

XuefengHuang
Copy link
Contributor

I fix savestate error message issue and create a unit test for this PR, this is test result:

Xuefengs-MacBook-Pro:runnable Xuefeng$ python utf.py -f ut_seash_savestate_nicermessage.py 
Testing module: seash
Now starting subprocess: ut_seash_subprocess.py
Generating user keys...
Generating owner key...
Writing config file...
Writing vessel dictionary...
Now running setup script: ut_seash_setup.py
    Running: ut_seash_setup.py                                  [ PASS ]
    Running: ut_seash_savestate_nicermessage.py                 [ PASS ]
Now stopping subprocess: ut_seash_subprocess.py
Removing: v1
Removing: v10
Removing: v2
Removing: v3
Removing: v4
Removing: v5
Removing: v6
Removing: v7
Removing: v8
Removing: v9

Add better error messages for two problems. One is using savestate before having loaded at least a pubkey, and work as that identity. Another is using savestate to a write-protected file.
#pragma out Don't use savestate to a write-protected file.

open('write_protected_file', 'w+').close()
os.system('chmod a-w write_protected_file')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work cross-platform (think Windows).

This unit test is to test error messages when using savestate before having loaded at least a pubkey, and work as that identity.
This unit test is to test error messages when using savestate to a write-protected file.
@asm582
Copy link

asm582 commented May 15, 2015

I have tested this pull request and this can be merged.

Testing by running unit test:

cib@cib-VirtualBox:/seash/RUNNABLE$ python utf.py -f ut_seash_savestate_nicermessageone.py
Testing module: seash
Running: ut_seash_savestate_nicermessageone.py [ PASS ]
cib@cib-VirtualBox:
/seash/RUNNABLE$ python utf.py -f ut_seash_savestate_nicermessagetwo.py
Testing module: seash
Running: ut_seash_savestate_nicermessagetwo.py [ PASS ]

Testing by manually entering command on seash:
cib@cib-VirtualBox:~/seash/RUNNABLE$ python seash.py

  • You can press the Tab key to enable tab complete when typing commands.

Enabled modules: factoids, geoip, modules, uploaddir, variables

!> savestate NO_KEYS_LOADED
Specify the key name by first typing 'as [username]'.
!> loadkeys guest0
as guest0
!> as guest0
guest0@ !> savestate write_protected_file
Permission denied: write_protected_file
guest0@ !> exit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants