# Test for presence functionality

house presence

framer presenter be active first setup
    frame setup
        do test opts setup master
        do salt raet manor lane setup per inode ".salt.lane.manor"
        do presenter test setup
        go next

    # A1, B*
    frame test_presence_available
        do test presence available
        do salt raet presenter
        do test presence available check
        do presenter test cleanup
        go next

    # A2
    frame test_presence_joined
        do test presence joined
        do salt raet presenter
        do test presence joined check
        do presenter test cleanup
        go next

    # A3
    frame test_presence_allowed
        do test presence allowed
        do salt raet presenter
        do test presence allowed check
        do presenter test cleanup
        go next

    # A4
    frame test_presence_alived
        do test presence alived
        do salt raet presenter
        do test presence alived check
        do presenter test cleanup
        go next

    # A5
    frame test_presence_reaped
        do test presence reaped
        do salt raet presenter
        do test presence reaped check
        do presenter test cleanup
        go next

    # C1
    frame test_presence_no_request
        do test presence no request
        do salt raet presenter
        do test presence no request check
        do presenter test cleanup
        go next

    # C2
    frame test_presence_unknown_src
        do test presence unknown src
        do salt raet presenter
        do test presence unknown src check
        do presenter test cleanup
        go next

    # D1
    frame test_presence_available_no_minions
        do test presence available no minions
        do salt raet presenter
        do test presence available no minions check
        do presenter test cleanup
        go next

    # D2
    frame test_presence_available_one_minion
        do test presence available one minion
        do salt raet presenter
        do test presence available one minion check
        do presenter test cleanup
        go next

    # D3
    frame test_presence_available_unknown_ip
        do test presence available unknown ip
        do salt raet presenter
        do test presence available unknown ip check
        do presenter test cleanup
        go next

    # D4
    frame test_presence_allowed_no_minions
        do test presence allowed no minions
        do salt raet presenter
        do test presence allowed no minions
        do presenter test cleanup
        go next

    # D4
    frame test_presence_allowed_one_minion
        do test presence allowed one minion
        do salt raet presenter
        do test presence allowed one minion
        do presenter test cleanup
        go next

    frame done
        go abort if meta.failure
        go success

    frame success
        print "Success"
        bid stop all

    frame abort
        print "Failure"
        bid stop all
