Repulsion is the surest test of magnetism. Because a magnet can attract a magnet as well as another magnetic substance but it can only repel a magnet, not any magnetic substance. Hence, if one end of iron bar is repelled by the north pole of a bar magnet then it's surely a magnet.
If both ends of the bar are attracted by the north pole that means it is just a magnetic material. Because if it would have been a magnet, then the north pole of the magnet would have repelled one of the ends of the iron bar.