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 registrar test for Solaris. #1258

Merged

Conversation

andrewkroh
Copy link
Member

And generally change the test to provide more verbose errors on failure.
I was tired of seeing 🔴 for the Solaris Jenkins job.

Python stat does not return the same device number as command line stat and Go. So I changed the test case to not compare the st_dev value with the device value from the registry file.

Solaris stat:

vagrant@solaris$ stat log/test.log 
  File: ‘log/test.log’
  Size: 60              Blocks: 2          IO Block: 512    regular file
Device: 11700010007h/1198295941127d     Inode: 6519        Links: 1
Access: (0644/-rw-r--r--)  Uid: (  100/ vagrant)   Gid: (   10/   staff)
Access: 2016-03-29 17:59:04.449807589 +0000
Modify: 2016-03-29 17:59:04.320733252 +0000
Change: 2016-03-29 17:59:04.320733252 +0000
 Birth: -

Python (st_dev is the device number):

>>> print os.stat("test.log")
posix.stat_result(st_mode=33188, st_ino=6519L, st_dev=73203719L, st_nlink=1, st_uid=100, st_gid=10, st_size=60L, st_atime=1459274344, st_mtime=1459274344, st_ctime=1459274344)

Registrar file created by Filebeat (Go):

{
  "/export/home/vagrant/go/src/github.com/elastic/beats/filebeat/build/system-tests/run/test_registrar.Test.test_registrar_file_content/log/test.log": {
    "source": "/export/home/vagrant/go/src/github.com/elastic/beats/filebeat/build/system-tests/run/test_registrar.Test.test_registrar_file_content/log/test.log",
    "offset": 60,
    "FileStateOS": {
      "inode": 10589,
      "device": 1198295941127
    }
  }
}

And generally change the test to provide more verbose errors on failure.
@tsg tsg merged commit 1b5b6c6 into elastic:master Mar 30, 2016
@andrewkroh andrewkroh deleted the bugfix/filebeat-solaris-registrar-test branch March 30, 2016 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants