spawn yangcli --user=$env(NCUSER) --server=$env(NCSERVER) --ncport=$env(NCPORT) --echo-requests=true --echo-replies=true --display-mode=xml --password=$env(NCPASSWORD)

expect {
    "yangcli $env(NCUSER)@$env(NCSERVER)>" {sleep 1}
    timeout {exit 1}
}

send "\@tmp/x.xml = fill test-module-list-input optional\n"

expect {
    "Fill non-mandatory container list?" {sleep 1}
    timeout {exit 1}
}

expect {
    "Enter Y for yes" {sleep 1}
    timeout {exit 1}
}

expect {
    "yangcli $env(NCUSER)@$env(NCSERVER):fill>" {sleep 1}
    timeout {exit 1}
}


send "Y\n"



expect {
    "Enter string value for leaf <a>" {sleep 1}
    timeout {exit 1}
}

expect {
    "yangcli $env(NCUSER)@$env(NCSERVER):fill>" {sleep 1}
    timeout {exit 1}
}

send "foo1\n"

expect {
    "Enter string value for leaf <b>" {sleep 1}
    timeout {exit 1}
}

expect {
    "yangcli $env(NCUSER)@$env(NCSERVER):fill>" {sleep 1}
    timeout {exit 1}
}

send "bar1\n"

expect {
    "Enter Y for yes" {sleep 1}
    timeout {exit 1}
}

send "N\n"

expect {
    "yangcli $env(NCUSER)@$env(NCSERVER)>" {sleep 1}
    timeout {exit 1}
}

send "test-module-list-input \@tmp/x.xml\n"

expect {
    "yangcli $env(NCUSER)@$env(NCSERVER)>" {sleep 1}
    timeout {exit 1}
}

expect {
    "RPC OK Reply" {sleep 1}
    timeout {exit 1}
}


send "quit\n"

expect {
    eof {exit 0}
    timeout {exit 1}
}
