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

ancestor not found in prefix map #185

Open
psagrera opened this issue Oct 28, 2016 · 2 comments
Open

ancestor not found in prefix map #185

psagrera opened this issue Oct 28, 2016 · 2 comments

Comments

@psagrera
Copy link

Hi

I'm getting the following error whenever run this testfile:

ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map
ERROR!! SyntaxError
Complete Message: prefix 'ancestor' not found in prefix map

show_chassis_hardware_detail:

  • command: show chassis hardware detail
  • item:
    id: name
    tests:
    • err: ' ERROR: HARDWARE_STATUS: ''HDD does not exits on RE0'
      exists: name
      info: Checking that HDD exits on RE0
      xpath: chassis/chassis-module[name = "Routing Engine 0"]//chassis-re-disk-module[name
      = "ad0"]
  • item:
    id: name
    tests:
    • err: ' ERROR: HARDWARE_STATUS: ''HDD does not exits on RE1'
      exists: name
      info: Checking that HDD exits on RE1
      xpath: chassis/chassis-module[name = "Routing Engine 1"]//chassis-re-disk-module[name
      = "ad1"]
  • item:
    id: name
    tests:
    • err: ' ERROR: HARDWARE_STATUS: ''CF does not exits on RE0'
      exists: name
      info: Checking that CF exits on RE0
      xpath: chassis/chassis-module[name = "Routing Engine 0"]//chassis-re-disk-module[name
      = "ad0"]
  • item:
    id: name
    tests:
    • err: ' ERROR: HARDWARE_STATUS: ''CF does not exits on RE1'
      exists: name
      info: Checking that CF exits on RE1
      xpath: chassis/chassis-module[name = "Routing Engine 1"]//chassis-re-disk-module[name
      = "ad1"]
  • iterate:
    id: name
    tests:
    • err: ' ERROR: HARDWARE_INVENTORY: Module name have changed in {{id_1}} ( PRE:
      {{pre["description"]}} / POST: {{post["description"]}} )'
      info: Checking chassis modules descriptions
      no-diff: description
    • err: ' ERROR: HARDWARE_INVENTORY: Module serial numbers have changed in {{id_1}}
      ( PRE: {{pre["serial-number"]}} / POST: {{post["serial-number"]}} )'
      info: Checking chassis modules serial numbers
      no-diff: serial-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module model numbers have changed in {{id_1}}
      ( PRE: {{pre["model-number"]}} / POST {{post["model-number"]}} )'
      info: Checking chassis modules model-number
      no-diff: model-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module part number have changed in {{id_1}}
      ( PRE: {{pre["part-number"]}} / POST {{post["part-number"]}} )'
      info: Checking chassis modules part-number
      no-diff: part-number
    • err: ' WARNING: HARDWARE_STATUS: {{id_1}} has been removed from the router.'
      info: Checking if chassis module have been removed
      list-not-less: name
    • err: ' WARNING: HARDWARE_STATUS: {{id_1}} has been inserted in the router.'
      info: Checking if new chassis module have been inserted in the router
      list-not-more: name
      xpath: chassis/chassis-module
  • iterate:
    id: name, ../name
    tests:
    • err: ' ERROR: HARDWARE_INVENTORY: Module name have changed in {{id_2}} {{id_1}}
      ( PRE: {{pre["description"]}} / POST: {{post["description"]}} )'
      info: Checking chassis submodules descriptions
      no-diff: description
    • err: ' ERROR: HARDWARE_INVENTORY: Module serial numbers have changed in {{id_2}}
      {{id_1}} ( PRE: {{pre["serial-number"]}} / POST: {{post["serial-number"]}}
      )'
      info: Checking chassis submodules serial numbers
      no-diff: serial-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module model numbers have changed in {{id_2}}
      {{id_1}} ( PRE: {{pre["model-number"]}} / POST {{post["model-number"]}}
      )'
      info: Checking chassis submodules model-number
      no-diff: model-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module part number have changed in {{id_2}}
      {{id_1}} ( PRE: {{pre["part-number"]}} / POST {{post["part-number"]}} )'
      info: Checking chassis submodules part-number
      no-diff: part-number
    • err: ' WARNING: HARDWARE_STATUS: {{id_2}} {{id_1}} has been removed from the
      router.'
      info: Checking if chassis submodules have been removed
      list-not-less: name
    • err: ' WARNING: HARDWARE_STATUS: {{id_2}} {{id_1}} has been inserted in the
      router.'
      info: Checking if new chassis submodules have been inserted in the router
      list-not-more: name
      xpath: //chassis/chassis-module/chassis-sub-module
  • iterate:
    id: name, ../name, ancestor::chassis-module//name
    tests:
    • err: ' ERROR: HARDWARE_INVENTORY: Module name have changed in {{id_3}} {{id_2}}
      {{id_1}} ( PRE: {{pre["description"]}} / POST: {{post["description"]}} )'
      info: Checking chassis sub-sub-modules descriptions
      no-diff: description
    • err: ' ERROR: HARDWARE_INVENTORY: Module serial numbers have changed in {{id_3}}
      {{id_2}} {{id_1}} ( PRE: {{pre["serial-number"]}} / POST: {{post["serial-number"]}}
      )'
      info: Checking chassis sub-sub-modules serial numbers
      no-diff: serial-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module model numbers have changed in {{id_3}}
      {{id_2}} {{id_1}} ( PRE: {{pre["model-number"]}} / POST {{post["model-number"]}}
      )'
      info: Checking chassis sub-sub-modules model-number
      no-diff: model-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module part number have changed in {{id_3}}
      {{id_2}} {{id_1}} ( PRE: {{pre["part-number"]}} / POST {{post["part-number"]}}
      )'
      info: Checking chassis sub-sub-modules part-number
      no-diff: part-number
    • err: ' WARNING: HARDWARE_STATUS: {{id_3}} {{id_2}} {{id_1}} has been removed
      from the router.'
      info: Checking if chassis sub-sub-modules have been removed
      list-not-less: name
    • err: ' WARNING: HARDWARE_STATUS: {{id_3}} {{id_2}} {{id_1}} has been inserted
      in the router.'
      info: Checking if new chassis sub-sub-modules have been inserted in the router
      list-not-more: name
      xpath: //chassis-sub-sub-module
  • iterate:
    id: name, ../name, ancestor::chassis-sub-module//name, ancestor::chassis-module//name
    tests:
    • err: ' ERROR: HARDWARE_INVENTORY: Module name have changed in {{id_4}} {{id_3}}
      {{id_2}} {{id_1}} ( PRE: {{pre["description"]}} / POST: {{post["description"]}}
      )'
      info: Checking chassis sub-sub-sub-modules descriptions
      no-diff: description
    • err: ' ERROR: HARDWARE_INVENTORY: Module serial numbers have changed in {{id_4}}
      {{id_3}} {{id_2}} {{id_1}} ( PRE: {{pre["serial-number"]}} / POST: {{post["serial-number"]}}
      )'
      info: Checking chassis sub-sub-sub-modules serial numbers
      no-diff: serial-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module model numbers have changed in {{id_4}}
      {{id_3}} {{id_2}} {{id_1}} ( PRE: {{pre["model-number"]}} / POST {{post["model-number"]}}
      )'
      info: Checking chassis sub-sub-sub-modules model-number
      no-diff: model-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module part number have changed in {{id_4}}
      {{id_3}} {{id_2}} {{id_1}} ( PRE: {{pre["part-number"]}} / POST {{post["part-number"]}}
      )'
      info: Checking chassis sub-sub-sub-modules part-number
      no-diff: part-number
    • err: ' WARNING: HARDWARE_STATUS: {{id_4}} {{id_3}} {{id_2}} {{id_1}} has been
      removed from the router.'
      info: Checking if chassis sub-sub-sub-modules have been removed
      list-not-less: name
    • err: ' WARNING: HARDWARE_STATUS: {{id_4}} {{id_3}} {{id_2}} {{id_1}} has been
      inserted in the router.'
      info: Checking if new chassis sub-sub-sub-modules have been inserted in the
      router
      list-not-more: name
      xpath: //chassis-sub-sub-sub-module
@ydnath
Copy link
Member

ydnath commented Oct 28, 2016

@psagrera Please check the usage of 'ancestor' in XPATH. It needs to be specific to a given XPATH. For example refer: http://stackoverflow.com/questions/3005370/xpath-to-find-nearest-ancestor-element-that-contains-an-element-that-has-an-attr

@psagrera
Copy link
Author

psagrera commented Nov 2, 2016

Hi @ydnath

Thanks for your response, I fixed this issue, however, I'm getting another error:

Example:

This is working:

  • iterate:
    id: name, ../name, //*[ancestor::chassis-module//name]
    tests:
    • err: ' ERROR: HARDWARE_INVENTORY: Module name have changed in {{id_3}} {{id_2}}
      {{id_1}} ( PRE: {{pre["description"]}} / POST: {{post["description"]}} )'
      info: Checking chassis sub-sub-modules descriptions
      no-diff: description
    • err: ' ERROR: HARDWARE_INVENTORY: Module serial numbers have changed in {{id_3}}
      {{id_2}} {{id_1}} ( PRE: {{pre["serial-number"]}} / POST: {{post["serial-number"]}}
      )'
      info: Checking chassis sub-sub-modules serial numbers
      no-diff: serial-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module model numbers have changed in {{id_3}}
      {{id_2}} {{id_1}} ( PRE: {{pre["model-number"]}} / POST {{post["model-number"]}}
      )'
      info: Checking chassis sub-sub-modules model-number
      no-diff: model-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module part number have changed in {{id_3}}
      {{id_2}} {{id_1}} ( PRE: {{pre["part-number"]}} / POST {{post["part-number"]}}
      )'
      info: Checking chassis sub-sub-modules part-number
      no-diff: part-number
    • err: ' WARNING: HARDWARE_STATUS: {{id_3}} {{id_2}} {{id_1}} has been removed
      from the router.'
      info: Checking if chassis sub-sub-modules have been removed
      list-not-less: name
    • err: ' WARNING: HARDWARE_STATUS: {{id_3}} {{id_2}} {{id_1}} has been inserted
      in the router.'
      info: Checking if new chassis sub-sub-modules have been inserted in the router
      list-not-more: name
      xpath: //chassis-sub-sub-module

however, this is not:

  • iterate:
    id: name, ../name, //[ancestor::chassis-sub-module//name], //[ancestor::chassis-module//name]
    tests:

    • err: ' ERROR: HARDWARE_INVENTORY: Module name have changed in {{id_3}}
      {{id_2}} {{id_1}} ( PRE: {{pre["description"]}} / POST: {{post["description"]}}
      )'
      info: Checking chassis sub-sub-sub-modules descriptions
      no-diff: description
    • err: ' ERROR: HARDWARE_INVENTORY: Module serial numbers have changed in {{id_4}}
      {{id_3}} {{id_2}} {{id_1}} ( PRE: {{pre["serial-number"]}} / POST: {{post["serial-number"]}}
      )'
      info: Checking chassis sub-sub-sub-modules serial numbers
      no-diff: serial-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module model numbers have changed in {{id_4}}
      {{id_3}} {{id_2}} {{id_1}} ( PRE: {{pre["model-number"]}} / POST {{post["model-number"]}}
      )'
      info: Checking chassis sub-sub-sub-modules model-number
      no-diff: model-number
    • err: ' ERROR: HARDWARE_INVENTORY: Module part number have changed in {{id_4}}
      {{id_3}} {{id_2}} {{id_1}} ( PRE: {{pre["part-number"]}} / POST {{post["part-number"]}}
      )'
      info: Checking chassis sub-sub-sub-modules part-number
      no-diff: part-number
    • err: ' WARNING: HARDWARE_STATUS: {{id_4}} {{id_3}} {{id_2}} {{id_1}} has been
      removed from the router.'
      info: Checking if chassis sub-sub-sub-modules have been removed
      list-not-less: name
    • err: ' WARNING: HARDWARE_STATUS: {{id_4}} {{id_3}} {{id_2}} {{id_1}} has been
      inserted in the router.'
      info: Checking if new chassis sub-sub-sub-modules have been inserted in the
      router
      list-not-more: name
      xpath: //chassis-sub-sub-sub-module

    .... getting this error:

Complete Message: cannot use absolute path on element

I can't figure out what's going on ....

command: show_chassis_hardware_detail

Thanks

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

No branches or pull requests

3 participants