According to The Family: A Proclamation to the World,
IN THE PREMORTAL REALM, spirit sons and daughters knew and worshipped
God as their Eternal Father and accepted His plan by which His
children could obtain a physical body and gain earthly experience to
progress toward perfection and ultimately realize their divine destiny
as heirs of eternal life. The divine plan of happiness enables family
relationships to be perpetuated beyond the grave. Sacred ordinances
and covenants available in holy temples make it possible for
individuals to return to the presence of God and for families to be
Specifically, the pre-existence (perhaps more correctly "pre-mortality" since the doctrine is we did, in fact, exist -- though I've seen the term used all over the place and I'm not sure why) consisted of all of God's children living in His presence. We were all taught the plan of salvation, or God's plan for us to come to earth, gain a body, and progress and be like Him.
We learned about agency (the power to choose), which we had before we came here. This included the choice to even come to earth and gain a body, which was God's plan. Those who rejected it followed Lucifer and were damned (stopped in their progression).
Both the Bible and certain LDS scriptures refer to those who chose to follow God in the pre-mortal life (and, to use your words, "passed the test") as those who "kept their first estate" (e.g. Jude 1:6; see also Isaiah 14).
In mortality here on Earth, we do not remember our pre-mortal life. The Bible refers to this as seeing "through a glass, darkly" -- or, in more common lingo, being separated by the veil. There will be death and resurrection, through which we will remember all things again.
To answer a comment, there is no doctrine of reincarnation in LDS theology. Birth to earth (that rhymes) was a one-time event, and after death we will be resurrected but not reincarnated. The whole process of mortality is a one-time process for each of us and mortality is not repeated.
The LDS Topical Guide to the Scriptures has a very helpful index for scriptures related to pre-mortal existence, many of which come right out of the Bible.
[ Further reading ]